Simple classifier that based on decision margins that are perpendicular to one of the space dimensions.
Inheritance Hierarchy Namespace: Accord.MachineLearning.Boosting.LearnersAccord.MachineLearning (in Accord.MachineLearning.dll) Version: 3.8.0
Syntax[SerializableAttribute] public class DecisionStump : BinaryClassifierBase<double[]>
<SerializableAttribute> Public Class DecisionStump Inherits BinaryClassifierBase(Of Double())Request Example View Source
The DecisionStump type exposes the following members.
Constructors Properties Methods Name Description Compute Obsolete.Computes the output class label for a given input.
Decide(TInput)Computes class-label decisions for a given set of input vectors.
(Inherited from ClassifierBaseTInput, TClasses.) Decide(Double)Computes a class-label decision for a given input.
(Overrides ClassifierBaseTInput, TClassesDecide(TInput).) Decide(TInput, Boolean)Computes class-label decisions for the given input.
(Inherited from BinaryClassifierBaseTInput.) Decide(TInput, TClasses)Computes a class-label decision for a given input.
(Inherited from ClassifierBaseTInput, TClasses.) EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object.) FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.) GetHashCodeServes as the default hash function.
(Inherited from Object.) GetTypeGets the Type of the current instance.
(Inherited from Object.) Learn Obsolete.Teaches the stump classifier to recognize the class labels of the given input samples.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object.) ToMulticlassViews this instance as a multi-class classifier, giving access to more advanced methods, such as the prediction of integer labels.
(Inherited from BinaryClassifierBaseTInput.) ToMultilabelViews this instance as a multi-label classifier, giving access to more advanced methods, such as the prediction of one-hot vectors.
(Inherited from BinaryClassifierBaseTInput.) ToStringReturns a string that represents the current object.
(Inherited from Object.) Transform(TInput)Applies the transformation to an input, producing an associated output.
(Inherited from ClassifierBaseTInput, TClasses.) Transform(TInput)Applies the transformation to a set of input vectors, producing an associated set of output vectors.
(Inherited from TransformBaseTInput, TOutput.) Transform(TInput, Boolean)Applies the transformation to an input, producing an associated output.
(Inherited from BinaryClassifierBaseTInput.) Transform(TInput, Double)Applies the transformation to an input, producing an associated output.
(Inherited from BinaryClassifierBaseTInput.) Transform(TInput, Int32)Applies the transformation to an input, producing an associated output.
(Inherited from BinaryClassifierBaseTInput.) Transform(TInput, Boolean)Applies the transformation to an input, producing an associated output.
(Inherited from BinaryClassifierBaseTInput.) Transform(TInput, Double)Applies the transformation to an input, producing an associated output.
(Inherited from BinaryClassifierBaseTInput.) Transform(TInput, Double)Applies the transformation to an input, producing an associated output.
(Inherited from BinaryClassifierBaseTInput.) Transform(TInput, Int32)Applies the transformation to an input, producing an associated output.
(Inherited from BinaryClassifierBaseTInput.) Transform(TInput, Int32)Applies the transformation to an input, producing an associated output.
(Inherited from BinaryClassifierBaseTInput.) Transform(TInput, TClasses)Applies the transformation to an input, producing an associated output.
(Inherited from ClassifierBaseTInput, TClasses.) Top Extension Methods Name Description HasMethodChecks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) IsEqualCompares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.) To(Type) Overloaded.Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) ToT Overloaded.Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) Top ExamplesThe DecisionStump classifier is mostly intended to be used as a weak classifier in the context of an AdaBoostTModel learning algorithm. Please refer to the AdaBoostTModel class for more examples on using the classifier in this scenario. A simple example is shown below:
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 }, }; bool[] outputs = { false, false, true, true, false, false, true }; var learner = new AdaBoost<DecisionStump>() { Learner = (p) => new ThresholdLearning(), MaxIterations = 5, Tolerance = 1e-3 }; Boost<DecisionStump> classifier = learner.Learn(inputs, outputs); ConfusionMatrix cm = ConfusionMatrix.Estimate(classifier, inputs, outputs); double error = cm.Error; double acc = cm.Accuracy; double kappa = cm.Kappa; bool y = classifier.Decide(inputs[0]);
It is also possible to use the DecisionStump as a standalone classifier through the ThresholdLearning algorithm. An example is given below:
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 }, }; bool[] outputs = { false, false, true, true, false, false, true }; var teacher = new ThresholdLearning(); DecisionStump classifier = teacher.Learn(inputs, outputs); var cm = ConfusionMatrix.Estimate(classifier, inputs, outputs); double error = cm.Error; bool y = classifier.Decide(new double[] { 71, 48 });See Also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4