Skip to content

data_process.py中 my_SVM函数是否有错误 #6

Description

@carain

首先感谢分享!

代码中:
score = f1_score(Pred_Y, Y_test, average='weighted')

其中Pred_Y, Y_test是否反了,看f1_scroe中的函数定义如下:

def f1_score(
    y_true,
    y_pred,
    *,
    labels=None,
    pos_label=1,
    average="binary",
    sample_weight=None,
    zero_division="warn",
):

y_true : 1d array-like, or label indicator array / sparse matrix
    Ground truth (correct) target values.

y_pred : 1d array-like, or label indicator array / sparse matrix
    Estimated targets as returned by a classifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions