Multi-classification evaluation indicator Python code

Source: Internet
Author: User

From Sklearn.metrics import Precision_score,recall_score

Print (Precision_score (y_true, y_scores,average= ' micro '))

The Sklearn.metrics module implements some loss, score, and some tool functions to calculate classification performance. Some metrics may require a probability estimate of a positive case, a confidence level, or a binary decision value. Most implementations allow each sample to provide a weighted distribution of the overall score, which is accomplished by the Sample_weight parameter.

Case used by some two classifications (binary classification):

    • Matthews_corrcoef (Y_true, y_pred)
    • Precision_recall_curve (Y_true, probas_pred)
    • Roc_curve (Y_true, y_score[, Pos_label, ...])

Some cases used by multiple classifications (Multiclass):

    • Confusion_matrix (Y_true, y_pred[, labels])
    • Hinge_loss (Y_true, pred_decision[, labels, ...])

Some multi-label (Multilabel) Cases:

    • Accuracy_score (Y_true, y_pred[, normalize, ...])
    • Classification_report (Y_true, y_pred[, ...])
    • F1_score (Y_true, y_pred[, labels, ...])
    • Fbeta_score (Y_true, y_pred, beta[, labels, ...])
    • Hamming_loss (Y_true, y_pred[, classes])
    • Jaccard_similarity_score (Y_true, y_pred[, ...])
    • Log_loss (Y_true, y_pred[, EPS, normalize, ...])
    • Precision_recall_fscore_support (Y_true, y_pred)
    • Precision_score (Y_true, y_pred[, labels, ...])
    • Recall_score (Y_true, y_pred[, labels, ...])
    • Zero_one_loss (Y_true, y_pred[, normalize, ...])

There are also some issues that can be used for both two-label and multi-label (not multi-classification):

    • Average_precision_score (Y_true, y_score[, ...])
    • Roc_auc_score (Y_true, y_score[, average, ...])

Multi-classification evaluation indicator Python code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.