• 三种评价函数


    from sklearn.metrics import confusion_matrix
    from sklearn.metrics import accuracy_score
    from sklearn.metrics import classification_report
    
    # accuracy_score()
    y_true = [0,1,2,3]
    y_pred = [0,2,1,3]
    print(accuracy_score(y_true=y_true,y_pred=y_pred))
    
    
    # confusion_matrix()
    y_true = [2,0,2,2,0,1]
    y_pred = [0,0,2,2,0,2]
    print(confusion_matrix(y_true,y_pred))
    
    # classification_report()
    y_true = [0,1,2,2,2]
    y_pred = [0,0,2,2,1]
    print(classification_report(y_true,y_pred))

     

    precision = 5 / 8  (预测中/视野)

    recall = 5 / 12 (预测中/个数总和)

    F1 - score = 2 * precision * recall / (precion + recall)

  • 相关阅读:
    【脑图】iOS的Crash分类和捕获
    Ruby03
    Ruby02
    Ruby01
    如何快速把一个十进制数转换为二进制?
    iOS
    互联网协议基本知识
    XCBB
    iOS
    iOS
  • 原文地址:https://www.cnblogs.com/TreeDream/p/10050616.html
Copyright © 2020-2023  润新知