TENSORFLOW MACHINE LEARNING: SIMPLE AND EFFECTIVE TIPS AND TRICKS TO LEARN MACHINE LEARNING WITH SCIKIT-LEARN, KERAS AND TENSORFLOW by Smith Benjamin

TENSORFLOW MACHINE LEARNING: SIMPLE AND EFFECTIVE TIPS AND TRICKS TO LEARN MACHINE LEARNING WITH SCIKIT-LEARN, KERAS AND TENSORFLOW by Smith Benjamin

Author:Smith, Benjamin [Smith, Benjamin]
Language: eng
Format: epub
Published: 2020-08-23T16:00:00+00:00


The cross_val_predict­() function uses K-fold-cross-validation to generate and display predictions made by the classifier on each fold. In this way, we save the testing set for the end of the project and get a good set of predictions as well.

Now that the requirement has been fulfilled, we can no proceed to use the confusion matrix. To do this, we will be employing the confusion_matrix() function by passing the original target classes (which are referred to as y_train_5 ) and prediction classes we just generated (which are referred to as y_train_pred ).

>>> from sklearn.metrics import confusion_matrix

>>> confusion_matrix(y_train_5, y_train_pred)

array([[53057, 1522],

[ 1325, 4096]])



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.