I'm trying to build a regression model for predicting mortality in users according to their lab reports, the thing is in my dataset each row is a different laboratory even for the same user, for example:
value start category unit type display record.death seed report_frequency
3 25.83 1291715668918 vital-signs kg/m2 39156-5 Body mass index (BMI) [Ratio] 1561456468918 -4803776664509238228 4
25 26.47 1318326868918 vital-signs kg/m2 39156-5 Body mass index (BMI) [Ratio] 1561456468918 -4803776664509238228 4
37 27.42 1386669268918 vital-signs kg/m2 39156-5 Body mass index (BMI) [Ratio] 1561456468918 -4803776664509238228 4
49 29.19 1481622868918 vital-signs kg/m2 39156-5 Body mass index (BMI) [Ratio] 1561456468918 -4803776664509238228 4
74 19.35 1196939625807 vital-signs kg/m2 39156-5 Body mass index (BMI) [Ratio] 1490267625807 401572787436335446 10
I'm not exactly sure what to use as my features, I'm using value, start (which is the laboratory date in timestamp) and type (which is the code for the metric type), and the goal variable is record.death, the thing is as you can see in the table I can have multiple rows per user according to how many times they visited the laboratory, I'm using linear regression but my mean squared error is too high, what could be wrong? Maybe I need to use another model for this case?