This repository has been archived by the owner on Nov 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Where is Accord.NET AdaBoost Decide method? #843
Labels
Milestone
Comments
I get accord.net source code and find Creation property that uses like
It seemed works like Decide method! But i don`t know about weights in Creation method!? @Accord.NET |
Hi @HamidEbr, Sorry for the delay. I will post below an example on how the AdaBoost class can be used: // Let's say we want to classify the following 2-dimensional
// data samples into 2 possible classes, either true or false:
double[][] inputs =
{
new double[] { 10, 42 },
new double[] { 162, 96 },
new double[] { 125, 20 },
new double[] { 96, 6 },
new double[] { 2, 73 },
new double[] { 52, 51 },
new double[] { 71, 49 },
};
// And those are their associated class labels
int[] outputs =
{
-1, -1, +1, +1, -1, -1, +1
};
// First, we create a classsifier using:
var classifier = new Boost<DecisionStump>();
// Now, we can create a AdaBoost learning algorithm as:
var teacher = new AdaBoost<DecisionStump>(classifier)
{
Creation = (weights) =>
{
var stump = new DecisionStump(2);
stump.Learn(inputs, outputs, weights);
return stump;
},
// Train until:
MaxIterations = 5,
Tolerance = 1e-3
};
// Now, we can use the Run method to learn:
double error = teacher.Run(inputs, outputs); // error should be zero.
// Now, we can compute the model outputs for new samples using
int y = classifier.Compute(new double[] { 71, 48 }); // should be 1 The API will be updated to follow the .Learn/Decide interface for the next release. Thanks again for opening the issue! Hope it helps, |
cesarsouza
added a commit
that referenced
this issue
Sep 7, 2017
Adding a new .Error property in ConfusionMatrix; Adding named constructors to ConfusionMatrix to create matrices directly from classifiers, their inputs and expected outputs. Updates: - GH-843: Where is Accord.NET AdaBoost Decide method? - GH-629: Add an Example for AdaBoost(TModel) Class - GH-424: Add an Example for AdaBoost(TModel) Class - GH-415: Add an Example for AdaBoost(TModel) Class
Added in 3.8.0. The new code examples can be found in the documentation pages for the AdaBoost meta-learning algorithm |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm trying to use Accord.NET library for objects classification, but I failed to find any suitable examples and documentation is not enough to understand the process. My current code is
This code works well, but i want to use Decide method like other classifiers in accord.net, how can i do it?
It seems that the Adaboost had been left behind when most of the existing classifiers were upgraded to the .Decide() API last year!
Here is stackoverflow topic of this request!
The text was updated successfully, but these errors were encountered: