harvitronix / five-video-classification-methods

Code that accompanies my blog post outlining five video classification methods in Keras and TensorFlow
https://medium.com/@harvitronix/five-video-classification-methods-implemented-in-keras-and-tensorflow-99cad29cc0b5
MIT License
1.17k stars 479 forks source link

Y_True value of validation generator #123

Open Devine43 opened 5 years ago

Devine43 commented 5 years ago

Hi I was wondering if someone would be able to tell me how to get the y_true values from the validation generator. I am using the conv_3d model and I want to create a classification report using the sklearn.mertrics.classification report. it requires the y_true and then y_predictions. I have the following code:

        print("[INFO] Get Predictions")
        predictions = rm.model.predict_generator(val_generator, 24, verbose=1)
        y_preds = np.argmax(predictions, axis=-1) 
        y_true = val_generator.argmax(axis=-1)
        cr = classification_report(y_true, y_preds)