I want to use an LSTM using Keras to make course grade predictions. My dataset includes student transcripts, which consist of courses taken and their respective grades of students. For each course, I plan to train an LSTM model that will take as input the student's previous courses and grades and output a predicted grade (from F to A). Each LSTM will be trained on all the student transcripts. The time steps will be semesters and the features of each time step will be the courses (and their grades). However, since not every student has spent the same number of semesters in school (i.e., time steps vary) and students take different courses in each time step (i.e., features vary), I do not know how to use a traditional LSTM.

I did some research and I understand that two ways of dealing with this problem are training one batch at a time and padding.

If I train with one batch at a time, how exactly does Keras do it? More specifically, how will the weight matrix be shaped and what dimensions will it have. Furthermore, when I want to use the model to make predictions, what should the dimensions of the input matrix on which the prediction is to be made be? Lastly, could someone please help me with the code for the one batch training part? Do I have to do a loop over my dataset matrix and train on each student transcript one at a time?

If I use padding, should I make the number of time steps and number of features the max of my dataset? This seems problematic as there are 1000+ different courses and so I would have to use a feature vector of 1000 and assign 0 to courses not taken, hence it seems that the model will take a lot of space and time to train/predict.

Thanks in advance.


Your Answer

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

Browse other questions tagged or ask your own question.