Skip to content

Exception when trying to Evaluate AveragedPerceptronTrainer, LinearSvm #1579

Description

@abgoswam

For a couple of Learners, we get an exception during Evaluate

  • AveragedPerceptronTrainer
  • LinearSvm

Exception :

Message: System.ArgumentOutOfRangeException : Probability column 'Probability' not found
Parameter name: name

Sample :

    [Fact]
    public void OVA_BC_AP()
    {
        string dataPath = GetDataPath("breast-cancer.txt");

        // Create a new context for ML.NET operations. It can be used for exception tracking and logging, 
        // as a catalog of available operations and as the source of randomness.
        var mlContext = new MLContext(seed: 1);
        var reader = new TextLoader(mlContext, new TextLoader.Arguments()
        {
            Column = new[]
                    {
                        new TextLoader.Column("Label", DataKind.R4, 0),
                        new TextLoader.Column("Features", DataKind.R4, new [] { new TextLoader.Range(1, 9) }),
                    }
        });

        // Data
        var data = reader.Read(GetDataPath(dataPath));

        // Pipeline
        var pipeline = new AveragedPerceptronTrainer(mlContext, "Label", "Features");

        var model = pipeline.Fit(data);
        var predictions = model.Transform(data);

        // Metrics
        var metrics = mlContext.BinaryClassification.Evaluate(predictions);
    }

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