Skip to content

Question: How to get accuracy in predicted label #317

Closed

Description

@epignosisx

Is it possible to get the accuracy/precision of a predicted label? Is there an attribute I can use the extract it? Basically some thing like:

public class EmployeePrediction
{
    [ColumnName("PredictedLabel")]
    public bool Outcome;

    [SomeAttribute]
    public float Accuracy;
}

Activity

  1. zeahmed commented on Jun 6, 2018

    @zeahmed
    Contributor

    Accuracy is actually a cumulative measure. It is computed on all the predictions in the dataset. You would like to see the following sample to know how to compute metrics for binary classification task.

    https://github.com/dotnet/machinelearning-samples/tree/master/samples/getting-started/BinaryClassification_SentimentAnalysis

    Basically, this what you would like to do after the model is trained.

    var testData = new TextLoader(TestDataPath).CreateFrom<SentimentData>();
    var evaluator = new BinaryClassificationEvaluator();
    var metrics = evaluator.Evaluate(model, testData);

    Variable metrics will contain all the computed metrics relevant to binary classification task.

  2. epignosisx commented on Jun 7, 2018

    @epignosisx
    Author

    Got it! Thanks.

  3. ridj87 commented on Jul 12, 2018

    @ridj87

    Is there a way to bring the metric data into the model.zip file ? Can I add it to the predictionmodel in some way? The scenario is that when the prediction comes as a response from, lets say an api that uses my trained model, I want to tell the user the certain percentage that the prediction is correct.

  4. ghost locked as resolved and limited conversation to collaborators on Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions