0
$\begingroup$

I'm new to machine learning, and I'm trying to think of a way to build a model that can suggest to a user if their next meal should be healthy or unhealthy. For instance, a user can set a goal: "Within 14 days, I want to have 70% healthy meals". As the user begins to record whether their current meal is healthy or unhealthy, the model will then suggest to the user if their next meal should be healthy or unhealthy in order for the user to achieve his/her goal.

How can I build a model to help achieve that? I was thinking of either using a time series or a decision tree, but I'm not sure if there are better ways to go about this. Appreciate any suggestions :)

$\endgroup$

1 Answer 1

0
$\begingroup$

I don't think you need a machine learning model for this. There's no data as such, which the machine can learn and give better predictions.

If the user needs 70 % healthy meals in 14 days, we simply need to maintain a count of the healthy meals and the total meals consumed by the user. As we need 70 % healthy meals, the user must be prompted to have a 'healthy' meal everyday with a probability of 0.7.

Considering a random variable $X$, such that $X \sim U( 0 , 1 )$, and if $X < 0.7$ then prompt the user to have a 'healthy' meal. By the law of large numbers, as the number of days increase, the user will have completed 70% healthy diets,

$$ P( \text{healthy} ) = 0.7 = \lim_{N \to \infty} \frac{\text{number of healthy meals in the first N meals}}{N} $$

In our case, as $N$ would never approach $\infty$, but would approach $14$,

$$ P( \text{healthy} ) \approx 0.7 \approx \lim_{N \to \infty} \frac{\text{number of healthy meals in the first N meals}}{N} $$

For better understanding, here's a plot which depicts the probability of having 70 % healthy meals in 60 days. Observe that as the number of days increase, we approach a better approximation of $P( \text{healthy} )$,

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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