STK++ 0.9.13
|
Interface base class for Regression methods. More...
#include <STK_IClassification.h>
Public Member Functions | |
virtual | ~IClassification () |
virtual destructor. | |
int | nbClass () const |
int | nbFreeParameter () const |
virtual bool | run () |
run the computations. | |
virtual bool | run (Weights_ const &weights) |
run the weighted computations. | |
![]() | |
virtual void | setX (XArray_ const &x) |
set the x data set (predictors). | |
virtual void | setY (YArray_ const &y) |
set the data set. | |
virtual void | setData (YArray_ const &y, XArray_ const &x) |
set the data set. | |
![]() | |
String const & | error () const |
get the last error message. | |
Protected Types | |
typedef IRunnerSupervised< YArray_, XArray_, Weights_ > | Base |
Protected Member Functions | |
IClassification () | |
Default constructor. | |
IClassification (YArray_ const *p_y, XArray_ const *p_x) | |
Constructor. | |
IClassification (YArray_ const &y, XArray_ const &x) | |
Constructor. | |
virtual bool | initializeStep () |
perform any computation needed before the call of the classification method. | |
virtual bool | predictionStep () |
Compute the predicted outputs by the classification function and store the result in the p_predicted_ array. | |
virtual bool | finalizeStep () |
perform any computation needed after the call of the classification method. | |
![]() | |
IRunnerSupervised () | |
default constructor | |
IRunnerSupervised (YArray_ const *const &p_y, XArray_ const *const &p_x) | |
constructor | |
IRunnerSupervised (YArray_ const &y, XArray_ const &x) | |
default constructor | |
IRunnerSupervised (IRunnerSupervised const &runner) | |
copy constructor | |
~IRunnerSupervised () | |
destructor | |
virtual void | updateY () |
update the runner when y data set is set. | |
virtual void | updateX () |
update the runner when x data set is set. | |
virtual void | update () |
update the runner. | |
![]() | |
IRunnerBase () | |
default constructor | |
IRunnerBase (IRunnerBase const &runner) | |
copy constructor | |
virtual | ~IRunnerBase () |
destructor | |
Protected Attributes | |
int | nbClass_ |
number of class | |
int | nbFreeParameter_ |
number of parameter of the classification method. | |
XArray_ const * | p_x_ |
A pointer on the x data set. | |
YArray_ const * | p_y_ |
A pointer on the y data set. | |
![]() | |
YArray_ const * | p_y_ |
A pointer on the y data set. | |
XArray_ const * | p_x_ |
A pointer on the x data set. | |
![]() | |
String | msg_error_ |
String with the last error message. | |
bool | hasRun_ |
true if run has been used, false otherwise | |
Private Member Functions | |
virtual bool | estimationStep ()=0 |
compute the classification function. | |
virtual bool | estimationStep (Weights_ const &weights)=0 |
compute the weighted classification function. | |
virtual int | computeNbFreeParameter () const =0 |
Compute the number of parameter of the classification function. | |
Interface base class for Regression methods.
In machine learning and statistics, classification is the problem of identifying to which of a set of categories (sub-populations) a new observation belongs, on the basis of a training set of data containing observations (or instances) whose category membership is known. An example would be assigning a given email into "spam" or "non-spam" classes or assigning a diagnosis to a given patient as described by observed characteristics of the patient (gender, blood pressure, presence or absence of certain symptoms, etc.). Classification is an example of pattern recognition.
In the terminology of machine learning, classification is considered an instance of supervised learning, i.e. learning where a training set of correctly identified observations is available. The corresponding unsupervised procedure is known as clustering, and involves grouping data into categories based on some measure of inherent similarity or distance.
Often, the individual observations are analyzed into a set of quantifiable properties, known variously as explanatory variables or features. These properties may variously be categorical (e.g. "A", "B", "AB" or "O", for blood type), ordinal (e.g. "large", "medium" or "small"), integer-valued (e.g. the number of occurrences of a particular word in an email) or real-valued (e.g. a measurement of blood pressure). Other classifiers work by comparing observations to previous observations by means of a similarity or distance function.
An algorithm that implements classification, especially in a concrete implementation, is known as a classifier. The term "classifier" sometimes also refers to the mathematical function, implemented by a classification algorithm, that maps input data to a category.
In this interface, the pure virtual function to implement are
The virtual function
can be overloaded.
The default behavior of the run
methods is
and it can be overloaded in derived class.
Definition at line 103 of file STK_IClassification.h.
|
protected |
Definition at line 106 of file STK_IClassification.h.
|
protected |
Default constructor.
Initialize the data members.
Definition at line 214 of file STK_IClassification.h.
|
protected |
Constructor.
Initialize the data members.
p_y,p_x | pointer array with the observed output and output |
Definition at line 220 of file STK_IClassification.h.
|
protected |
Constructor.
Initialize the data members.
y,x | arrays with the observed output and input |
Definition at line 230 of file STK_IClassification.h.
|
inlinevirtual |
|
privatepure virtual |
Compute the number of parameter of the classification function.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().
|
privatepure virtual |
compute the classification function.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().
|
privatepure virtual |
compute the weighted classification function.
weights | the weights of the samples |
|
inlineprotectedvirtual |
perform any computation needed after the call of the classification method.
Default implementation is do nothing.
Definition at line 197 of file STK_IClassification.h.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().
|
inlineprotectedvirtual |
perform any computation needed before the call of the classification method.
Default implementation is do nothing.
Definition at line 189 of file STK_IClassification.h.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().
|
inline |
Definition at line 125 of file STK_IClassification.h.
References STK::IClassification< YArray_, XArray_, Weights_ >::nbClass_.
|
inline |
Definition at line 127 of file STK_IClassification.h.
References STK::IClassification< YArray_, XArray_, Weights_ >::nbFreeParameter_.
|
inlineprotectedvirtual |
Compute the predicted outputs by the classification function and store the result in the p_predicted_ array.
Default implementation is do nothing.
Definition at line 193 of file STK_IClassification.h.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().
run the computations.
Default Implementation.
Implements STK::IRunnerSupervised< YArray_, XArray_, Weights_ >.
Definition at line 130 of file STK_IClassification.h.
References STK::IClassification< YArray_, XArray_, Weights_ >::computeNbFreeParameter(), STK::IClassification< YArray_, XArray_, Weights_ >::estimationStep(), STK::IClassification< YArray_, XArray_, Weights_ >::finalizeStep(), STK::IRunnerBase::hasRun_, STK::IClassification< YArray_, XArray_, Weights_ >::initializeStep(), STK::IRunnerBase::msg_error_, STK::IClassification< YArray_, XArray_, Weights_ >::nbFreeParameter_, STK::IClassification< YArray_, XArray_, Weights_ >::p_x_, STK::IClassification< YArray_, XArray_, Weights_ >::p_y_, STK::IClassification< YArray_, XArray_, Weights_ >::predictionStep(), STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STKERROR_NO_ARG.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().
|
inlinevirtual |
run the weighted computations.
weights | weights of the samples |
Implements STK::IRunnerSupervised< YArray_, XArray_, Weights_ >.
Definition at line 155 of file STK_IClassification.h.
References STK::IClassification< YArray_, XArray_, Weights_ >::computeNbFreeParameter(), STK::IClassification< YArray_, XArray_, Weights_ >::estimationStep(), STK::IClassification< YArray_, XArray_, Weights_ >::finalizeStep(), STK::IRunnerBase::hasRun_, STK::IClassification< YArray_, XArray_, Weights_ >::initializeStep(), STK::IRunnerBase::msg_error_, STK::IClassification< YArray_, XArray_, Weights_ >::nbFreeParameter_, STK::IClassification< YArray_, XArray_, Weights_ >::p_x_, STK::IClassification< YArray_, XArray_, Weights_ >::p_y_, STK::IClassification< YArray_, XArray_, Weights_ >::predictionStep(), STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STKERROR_NO_ARG.
|
protected |
number of class
Definition at line 182 of file STK_IClassification.h.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::nbClass().
|
protected |
number of parameter of the classification method.
Definition at line 184 of file STK_IClassification.h.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::nbFreeParameter(), STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().
A pointer on the x data set.
Definition at line 347 of file STK_IRunner.h.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().
A pointer on the y data set.
Definition at line 345 of file STK_IRunner.h.
Referenced by STK::IClassification< YArray_, XArray_, Weights_ >::run(), and STK::IClassification< YArray_, XArray_, Weights_ >::run().