簡體   English   中英

在 ML.NET 異常檢測中獲取時間戳

[英]Get Timestamp in ML.NET Anomaly detection

我正在關注本教程: 使用 ML.NET 進行異常檢測,結果如下所示:

Alert   Score   P-Value 
0       271.00  0.50    
0       124.30  0.13    
1       341.50  0.00 <-- Spike detected
0       197.80  0.48    
0       127.90  0.13    

但在我的數據中,我也有一個時間戳。 是否可以在結果中看到時間戳?

Alert   Score   P-Value Timestamp
0       271.00  0.50    2022-06-01: 22:30:15
0       124.30  0.13    2022-06-01: 22:30:20
1       341.50  0.00    2022-06-01: 22:30:25 <-- Spike detected
0       197.80  0.48    2022-06-01: 22:30:30
0       127.90  0.13    2022-06-01: 22:30:35

如果不可能,我如何使用結果?

如果這是您數據集中的一列,您可以在 Input / Output 類中定義它。

https://docs.microsoft.com/dotnet/machine-learning/tutorials/sales-anomaly-detection#create-classes-and-define-paths

將屬性添加到您的 TimeStamp 列的類中。 IE

public class ProductSalesData
{
    [LoadColumn(0)]
    public string Month;

    [LoadColumn(1)]
    public float numSales;

    [LoadColumn(2)]
    public string TimeStamp;
}

public class ProductSalesPrediction
{
    public string TimeStamp;

    //vector to hold alert,score,p-value values
    [VectorType(3)]
    public double[] Prediction { get; set; }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM