lccasagrande / Deep-Knowledge-Tracing

An implementation of the Deep Knowledge Tracing (DKT) using Tensorflow 2.0
MIT License
95 stars 38 forks source link

how can i find probabilities of skill? #12

Open starryeg opened 3 years ago

starryeg commented 3 years ago

Hello there Appreciate your codes first! btw i wanna know its probability of skill and can you pls let me know how can i find it? Many thanks

danielcfurr commented 3 years ago

I believe I worked out how to do this. We can get the probabilities by using the predict method for the fitted model:

model.predict(train_set)

This will throw an error however. Something wrong happens with the padded sequence dimensions when predicting, even though we don't have that problem when fitting the model initially. Changing "Step 7" in data_utils.py as follows can eliminate that error:

# Step 7 - Pad sequences per batch
max_sequence_length = max(df.groupby('user_id').agg(seq_length=('user_id', len))['seq_length'])
dataset = dataset.padded_batch(
    batch_size=batch_size,
    padding_values=(MASK_VALUE, MASK_VALUE),
    padded_shapes=([max_sequence_length, None], [max_sequence_length, None]),         
    drop_remainder=True
)

Edit: There is a downside that this approach provides predictions for the padded parts of the sequences.

Blackbird95x commented 2 years ago

Is there any way the padded part is not used in the predcitions ?