1
$\begingroup$

I have a dataset of diabetes patients and I am trying to predict the next blood glucose level. I have attached an image below and I have about 1600 records in that csv file containing data of 10 patients. Each patient is uniquely identified by the Id column and the Glucose_t-1 means the glucose value in which the patient had before the current reading(Glucose_t) likewise this apply to Glucose_t-2 and Glucose_t-3. And same applies to the Insulin_t-1,Insulin_t-2. The event column is the Glycemic event in which the current reading of the blood glucose value falls to. For example,

  • blood glucose value <= 70 then 0,
  • 70< blood glucose value <=180 then 1,
  • blood glucose value > 180 then 2.

I have applied different regression algorithms like Logisitic Regression, Random Forest Regression and so on but I was unable to predict the Glucose_t value accurately. The accuracy comes to 0.008.. which is very depressing :(. Please any help to improve the accuracy of will be greatly appreciated. Thanks.This is the format i have prepared in the csv file

$\endgroup$
1
$\begingroup$

It's a quite complex problem and there might be better options for the design (I'm thinking maybe something more specific to times series)...

However before that there's a more obvious problem to solve: it seems that you are calculating accuracy on the "Glucose_t" numeric value, right? If yes this is incorrect and that would explain your terrible results:

  • Accuracy is an evaluation measure for classification tasks, not for regression tasks: accuracy simply checks for each instance whether the predicted value (which is supposed to be a categorical value) is the same as the gold true value, and then divides the number of correct cases by the total. Naturally it's very hard to predict the exact true value in the case of numbers: if the true value is 183 but the algorithm predicts 184, then accuracy would count that as incorrect even though it's very close. That would explain why your accuracy is very low.
  • Typical regression evaluation measures are mean absolute error and mean squared errors. These measures (and their variants) are designed to calculate how far the predicted numerical value is from the true value. If you use these keep in mind that it's an error score, so the lower the value the better.
  • If you want to use accuracy, it would make sense to use it on your "event" value (which is derived from your "glucose_t" prediction I assume?): in this case you have 3 classes (categorical values), and I bet the accuracy will be much better. Note that accuracy can be biased by class imbalance, so don't forget to check the confusion matrix.
$\endgroup$
10
  • $\begingroup$ Hey @Erwan, yeah you are correct. But unfortunately, my RMSE is about 0.80 which is really inaccurate when predicting the Glucose_t. Further, the accuracy for predicting the Event is 64%. So any way to improve the accuracy and reduce the RMSE :( $\endgroup$
    – HelloWorld
    Feb 13 '20 at 0:13
  • $\begingroup$ Ok, 0.8 is a normalized error score right? Anyway, now you're reaching the hard part: first, I assume that glucose levels fluctuate a lot right? As a rule of thumb if they are not easy to predict by a human expert they're probably going to be hard also for ML. Still you could try a few things: I'm thinking at least trying to increase the last t-N values beyond t-3, e.g. the last 5, 10 or even 20. A more advanced option would be to use a model which specifically deals with time series, it's likely to capture chronological patterns better... $\endgroup$
    – Erwan
    Feb 13 '20 at 0:48
  • $\begingroup$ ... Unfortunately I'm not really knowledgeable about these, so if you're interested I think you should ask a new question about that. $\endgroup$
    – Erwan
    Feb 13 '20 at 0:49
  • $\begingroup$ No I didn't Normalize anything @Erwin. Btw should I normalize every column in my dataset? When I did the predictions I removed the Meal column since it's already represented by binary in Breakfast, Lunch and Dinner columns. $\endgroup$
    – HelloWorld
    Feb 13 '20 at 1:22
  • $\begingroup$ I further performed feature selection and drew the correlation matrix with heat map. It shows that Glucose_t-1,Glucose_t-2 and Glucose_t-3, are highly correlated when compared to the other columns in the dataset, but their correlation value is not that high since the maximum correlated one is Glucose_t- 1 which is 0.24?? $\endgroup$
    – HelloWorld
    Feb 13 '20 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.