M
M
Maxim Shimko2017-10-01 22:28:28
C++ / C#
Maxim Shimko, 2017-10-01 22:28:28

Why does an exception occur in accord.net in C#?

The code:

var teacher = new RandomForestLearning()
{
    NumberOfTrees = 10, // use 10 trees in the forest
};
var forest = teacher.Learn(input, output);//Exception

input - two-dimensional array double[][] with different data, 3k+ rows, 25 columns.
output is an int[] array with different data.
Exception: System.ArgumentException: "Attribute 24 is a constant."
I can not understand what is wrong, because all the data is different.
Link to the library: accord-framework.net/docs/html/T_Accord_MachineLea...
I also took an example there, only my data.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2017-10-01
@d-stream

Well, for starters, it’s worth saying what kind of exception occurs.
And so - by the link we look at the source and at least we see:

public RandomForest Learn(double[][] x, int[] y, double[] weights = null) 
        { 
            if (weights != null) 
                 throw new ArgumentException(Accord.Properties.Resources.NotSupportedWeights, "weights");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question