metrics scikitlearn code example
Example 1: cross_val_score scoring parameters types
>>> from sklearn import svm, cross_validation, datasets
>>> iris = datasets.load_iris()
>>> X, y = iris.data, iris.target
>>> model = svm.SVC()
>>> cross_validation.cross_val_score(model, X, y, scoring='wrong_choice')
Traceback (most recent call last):
ValueError: 'wrong_choice' is not a valid scoring value. Valid options are ['accuracy', 'adjusted_rand_score', 'average_precision', 'f1', 'log_loss', 'mean_absolute_error', 'mean_squared_error', 'precision', 'r2', 'recall', 'roc_auc']
Example 2: sklearn.metrics accuracy_score
// syntax:
// - sklearn.metrics.accuracy_score(y_true, y_pred, *, normalize=True, sample_weight=None)