internal AnomalyDetectionMetrics(IExceptionContext ectx, DataViewRow overallResult)
        {
            double FetchDouble(string name) => RowCursorUtils.Fetch <double>(ectx, overallResult, name);

            AreaUnderRocCurve = FetchDouble(BinaryClassifierEvaluator.Auc);
            DetectionRateAtKFalsePositives = FetchDouble(AnomalyDetectionEvaluator.OverallMetrics.DrAtK);
        }
 internal RegressionMetrics(IExceptionContext ectx, DataViewRow overallResult)
 {
     double Fetch(string name) => RowCursorUtils.Fetch<double>(ectx, overallResult, name);
     MeanAbsoluteError = Fetch(RegressionEvaluator.L1);
     MeanSquaredError = Fetch(RegressionEvaluator.L2);
     RootMeanSquaredError = Fetch(RegressionEvaluator.Rms);
     LossFunction = Fetch(RegressionEvaluator.Loss);
     RSquared = Fetch(RegressionEvaluator.RSquared);
 }
        internal RegressionMetrics(IExceptionContext ectx, DataViewRow overallResult)
        {
            double Fetch(string name) => RowCursorUtils.Fetch <double>(ectx, overallResult, name);

            L1       = Fetch(RegressionEvaluator.L1);
            L2       = Fetch(RegressionEvaluator.L2);
            Rms      = Fetch(RegressionEvaluator.Rms);
            LossFn   = Fetch(RegressionEvaluator.Loss);
            RSquared = Fetch(RegressionEvaluator.RSquared);
        }
Esempio n. 4
0
        internal ClusteringMetrics(IExceptionContext ectx, Row overallResult, bool calculateDbi)
        {
            double Fetch(string name) => RowCursorUtils.Fetch <double>(ectx, overallResult, name);

            Nmi         = Fetch(ClusteringEvaluator.Nmi);
            AvgMinScore = Fetch(ClusteringEvaluator.AvgMinScore);

            if (calculateDbi)
            {
                Dbi = Fetch(ClusteringEvaluator.Dbi);
            }
        }
Esempio n. 5
0
        internal ClusteringMetrics(IExceptionContext ectx, DataViewRow overallResult, bool calculateDbi)
        {
            double Fetch(string name) => RowCursorUtils.Fetch <double>(ectx, overallResult, name);

            NormalizedMutualInformation = Fetch(ClusteringEvaluator.Nmi);
            AverageDistance             = Fetch(ClusteringEvaluator.AvgMinScore);

            if (calculateDbi)
            {
                DaviesBouldinIndex = Fetch(ClusteringEvaluator.Dbi);
            }
        }
Esempio n. 6
0
        internal MulticlassClassificationMetrics(IHost host, DataViewRow overallResult, int topKPredictionCount, IDataView confusionMatrix)
        {
            double FetchDouble(string name) => RowCursorUtils.Fetch<double>(host, overallResult, name);
            MicroAccuracy = FetchDouble(MulticlassClassificationEvaluator.AccuracyMicro);
            MacroAccuracy = FetchDouble(MulticlassClassificationEvaluator.AccuracyMacro);
            LogLoss = FetchDouble(MulticlassClassificationEvaluator.LogLoss);
            LogLossReduction = FetchDouble(MulticlassClassificationEvaluator.LogLossReduction);
            TopKPredictionCount = topKPredictionCount;
            if (topKPredictionCount > 0)
                TopKAccuracy = FetchDouble(MulticlassClassificationEvaluator.TopKAccuracy);

            var perClassLogLoss = RowCursorUtils.Fetch<VBuffer<double>>(host, overallResult, MulticlassClassificationEvaluator.PerClassLogLoss);
            PerClassLogLoss = perClassLogLoss.DenseValues().ToImmutableArray();
            ConfusionMatrix = MetricWriter.GetConfusionMatrix(host, confusionMatrix, binary: false, perClassLogLoss.Length);
        }
Esempio n. 7
0
        internal MultiClassClassifierMetrics(IExceptionContext ectx, DataViewRow overallResult, int topK)
        {
            double FetchDouble(string name) => RowCursorUtils.Fetch <double>(ectx, overallResult, name);

            MicroAccuracy    = FetchDouble(MultiClassClassifierEvaluator.AccuracyMicro);
            MacroAccuracy    = FetchDouble(MultiClassClassifierEvaluator.AccuracyMacro);
            LogLoss          = FetchDouble(MultiClassClassifierEvaluator.LogLoss);
            LogLossReduction = FetchDouble(MultiClassClassifierEvaluator.LogLossReduction);
            TopK             = topK;
            if (topK > 0)
            {
                TopKAccuracy = FetchDouble(MultiClassClassifierEvaluator.TopKAccuracy);
            }

            var perClassLogLoss = RowCursorUtils.Fetch <VBuffer <double> >(ectx, overallResult, MultiClassClassifierEvaluator.PerClassLogLoss);

            PerClassLogLoss = perClassLogLoss.DenseValues().ToImmutableArray();
        }
Esempio n. 8
0
        internal MultiClassClassifierMetrics(IExceptionContext ectx, Row overallResult, int topK)
        {
            double FetchDouble(string name) => RowCursorUtils.Fetch <double>(ectx, overallResult, name);

            AccuracyMicro    = FetchDouble(MultiClassClassifierEvaluator.AccuracyMicro);
            AccuracyMacro    = FetchDouble(MultiClassClassifierEvaluator.AccuracyMacro);
            LogLoss          = FetchDouble(MultiClassClassifierEvaluator.LogLoss);
            LogLossReduction = FetchDouble(MultiClassClassifierEvaluator.LogLossReduction);
            TopK             = topK;
            if (topK > 0)
            {
                TopKAccuracy = FetchDouble(MultiClassClassifierEvaluator.TopKAccuracy);
            }

            var perClassLogLoss = RowCursorUtils.Fetch <VBuffer <double> >(ectx, overallResult, MultiClassClassifierEvaluator.PerClassLogLoss);

            PerClassLogLoss = new double[perClassLogLoss.Length];
            perClassLogLoss.CopyTo(PerClassLogLoss);
        }