Would a Logistic Regression Machine Learning Model Work Here? I am in 10th grade and I am looking to use a machine learning model on patient data to find a correlation between the time of week and patient adherence. I have separated the week into 21 time slots, three for each time of day (1 is Monday morning, 2 is monday afternoon, etc.). Adherence values will be binary (0 means they did not take the medicine, 1 means they did). I will simulate training, validation and test data for my model. From my understanding, I can use a logistic regression model to output the probability of the patient missing their medication on a certain time slot given past data for that time slot. This is because logistic regression outputs binary values when given a threshold and is good for problems dealing with probability and binary classes, which is my scenario. In my case, the two classes I am dealing with are yes they will take their medicine, and no they will not. But the major problem with this is that this data will be non-linear, at least to my understanding. To make this more clear, let me give a real life example. If a patient has yoga class on Sunday mornings, (time slot 19) and tends to forget to take their medication at this time, then most of the numbers under time slot 19 would be 0s, while all the other time slots would have many more 1s. The goal is to create a machine learning model which can realize given past data that the patient is very likely going to miss their medication on the next time slot 19. I believe that logistic regression must be used on data that still has an inherently linear data distribution, however I am not sure. I also understand that neural networks are ideal for non-linear distributions, but neural networks require a lot of data to function properly, and ideally the goal of my model is to be able to function decently with simply a few weeks of data. Of course any model becomes more accurate with more data, but it seems to me that generally neural networks need thousands of data sets to truly become decently accurate. Again, I could very well be wrong. 
My question is really what model type would work here. I do know that I will need some form of supervised classification. But can I use logistic regression to make predictions when given time of week about adherence? 
Really any general feedback on my project is greatly appreciated! Please keep in mind I am only 15, and so certain statements I made were possibly wrong and I will not be able to fully understand very complex replies.
I also have to complete this within the next two weeks, so please do not hesitate to respond as soon as you can! Thank you so much!
 A: If I understand you correctly, you have a single input, day_time, which is nonlinear, as stated in example.
Logistic regression is linear in its inputs, however, you are free to make nonlinear transformations of your original inputs and use those as inputs.
In your case you could dummy code day_time into 21 Boolean variables. In fact I would use one dummy code for day-of week, one for time of day, and then also create the interactions ( = day_x_time_y). You would then also create interaction with the patient ids, to cover individual effects as you described (person X only missing daytime slot 19). You would then regularise the model using L1 or L2 regularisation. This model would then identify day patterns, or time patterns, or patient X time patterns. Regularisation ensures that the model aims to have as general a model as possible ( if most people miss on Monday, then the model will pick up a general Monday effect,rather than learning a Monday effect separately for each patient).
You can do what I describe by using the https://patsy.readthedocs.io/en/latest/quickstart.html and scikit learn packages.
You would provide a formula such as 
Medicine taken ~ hour * day* person,
And patsy would create a matrix of  all the base variables and every possible interaction.you would then pass this matrix to scikit learn to perform the regularised logistic regression
As an alternative model you could use a tree model such as xgboost, but I would still break day_time into two separate variables, day and time
