How to find the metrics for cross folds validation process.

For example, I have the following data.

clf=classificationModel

MyX=Feature-Vector

MyY=targets

I followed below syntax for classification process:

y_pred = cross_val_predict(clf,MyX,MyY,cv=10)

Metrics calculation for cross-fold validation, syntaxes that I followed are:

totacu=round((metrics.accuracy_score(MyY,y_pred)*100),3)

totMisacu=round((1-metrics.accuracy_score(MyY,y_pred))*100,3)

sensitivityVal=round((metrics.recall_score(MyY,y_pred))*100,3)

precision=round((metrics.precision_score(MyY,y_pred))*100,3);

f1score=round(2*((sensitivityVal*precision)/(sensitivityVal+precision)),2)

Please explain whether this process is correct.

Similar questions and discussions