ML.NET RandomizedPCA Trainer AUC not defined



首次学习如何使用ML.NET想在数据库上尝试异常检测。我检索到以下数据:

public string Title { get; set; }
public string CertValidFrom { get; set; }
public string CertValidTo { get; set; }
public float Label { get; set; }

RandomizedPCTrainer需要标签,并且标签设置为0。我还附赠了文字:

IEstimator<ITransformer> dataProcessPipeline = mLContext.Transforms
.Text.FeaturizeText("TitleF", "Title")
.Append(mLContext.Transforms.Text.FeaturizeText("CertValidFromF", "CertValidFrom"))
.Append(mLContext.Transforms.Text.FeaturizeText("CertValidToF", "CertValidTo"))
.Append(mLContext.Transforms.Concatenate("Features", "TitleF", "CertValidFromF", "CertValidToF"));

然后我使用了以下选项:

var options = new RandomizedPcaTrainer.Options {
FeatureColumnName = "Features",
ExampleWeightColumnName = null,
Rank = 28,
Oversampling = 20,
EnsureZeroMean = true,
Seed = 1};

但当用测试数据评估模型时,我会得到以下错误:

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in Microsoft.ML.Core.dll: 'AUC is not defined when there is no positive class in the data'

我没有太多经验,所以我的问题是:

  • 这个错误说明了什么
  • dataProcessPipeline正确吗?它的作用是什么

长话短说,这个算法不适合我的数据集,所以我尝试了一些不同的算法。因此,要注意始终研究您选择的算法的用例。

之所以会发生这种情况,是因为被评估数据ara的标签列值都属于同一类。因此,它没有抛出阳性的类表达式,也不能在没有阳性样本的情况下回避数据。(至少它不能计算auc值(

最新更新