Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IForestOutlierBatchOp进行异常检测时,输出结果顺序颠倒 #231

Open
LXF0047 opened this issue Mar 28, 2023 · 0 comments
Open

Comments

@LXF0047
Copy link

LXF0047 commented Mar 28, 2023

`

    String[] FEATURE_NAMES = {"f1", "f2", "f3", "f4", "f5",
            "f6", "f7", "f8", "f9"};
    String[] ALL_NAMES = {"f1", "f2", "f3", "f4", "f5",
            "f6", "f7", "f8", "f9", "label"};
    BatchOperator <?> data = new MemSourceBatchOp(
            new Object[][] {
                    {10, 10, 10, 10, 10, 10, 10, 10, 10, 0},
                    {10, 10, 10, 10, 10, 10, 10, 10, 10, 0},
                    {10, 10, 10, 10, 10, 10, 10, 10, 10, 0},
                    {10, 10, 10, 10, 10, 10, 10, 10, 10, 0},
                    {10, 10, 10, 10, 10, 10, 10, 10, 10, 0},
                    {1, 1, 1, 1, 1, 1, 1, 1, 100, 1},
                    {1, 1, 1, 1, 1, 1, 1, 1, 200, 1},
                    {1, 1, 1, 1, 1, 1, 1, 1, 300, 1},
            },
            ALL_NAMES);
    BatchOperator <?> outlier = new IForestOutlierBatchOp()
            .setFeatureCols(FEATURE_NAMES)
            .setPredictionCol("pred")
            .setPredictionDetailCol("pred_detail");
    data.link(outlier).print();

`
的运行结果为:

f1 f2 f3 f4 f5 f6 f7 f8 f9 label pred pred_detail
10 10 10 10 10 10 10 10 10 0 true {"outlier_score":"0.5907573613555553","is_outlier":"true"}
10 10 10 10 10 10 10 10 10 0 true {"outlier_score":"0.5496377996962295","is_outlier":"true"}
10 10 10 10 10 10 10 10 10 0 true {"outlier_score":"0.5988412960965512","is_outlier":"true"}
10 10 10 10 10 10 10 10 10 0 false {"outlier_score":"0.48774601295119835","is_outlier":"false"}
10 10 10 10 10 10 10 10 10 0 false {"outlier_score":"0.48774601295119835","is_outlier":"false"}
1 1 1 1 1 1 1 1 100 1 false {"outlier_score":"0.48774601295119835","is_outlier":"false"}
1 1 1 1 1 1 1 1 200 1 false {"outlier_score":"0.48774601295119835","is_outlier":"false"}
1 1 1 1 1 1 1 1 300 1 false {"outlier_score":"0.48774601295119835","is_outlier":"false"}

后三行的结果跑到前三行中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant