Skip to content
Snippets Groups Projects
Commit eddcfdcf authored by Julien Malik's avatar Julien Malik
Browse files

DOC: update doxygen of MachineLearningModel

parent 67582651
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,40 @@
namespace otb
{
/** \class MachineLearningModel
* \brief MachineLearningModel is the base class for all classifier objects (SVM, KNN,
* Random Forests, Artificial Neural Network, ...) implemented in the supervised classification framework of the OTB.
*
* MachineLearningModel is an abstract object that specifies behavior and
* interface of supervised classifiers (SVM, KNN, Random Forests, Artificial
* Neural Network, ...) in the generic supervised classification framework of the OTB.
* The main generic virtual methods specifically implemented in each classifier
* derived from the MachineLearningModel class are two learning-related methods:
* Train() and Save(), and two classification-related methods: Load() and Predict().
*
* Thus, each classifier derived from the MachineLearningModel class
* computes its corresponding model with Train() and exports it with
* the help of the Save() method.
*
* It is also possible to classify any input sample composed of several
* features (or any number of bands in the case of a pixel extracted
* from a multi-band image) with the help of the Predict() method which
* needs a previous loading of the classification model with the Load() method.
*
* \sa MachineLearningModelFactory
* \sa LibSVMMachineLearningModel
* \sa SVMMachineLearningModel
* \sa BoostMachineLearningModel
* \sa KNearestNeighborsMachineLearningModel
* \sa DecisionTreeMachineLearningModel
* \sa RandomForestsMachineLearningModel
* \sa GradientBoostedTreeMachineLearningModel
* \sa NormalBayesMachineLearningModel
* \sa NeuralNetworkMachineLearningModel
* \sa ImageClassificationFilter
*
*/
template <class TInputValue, class TTargetValue>
class ITK_EXPORT MachineLearningModel
: public itk::Object
......@@ -54,29 +88,41 @@ public:
/** Predict values using the model */
virtual TargetSampleType Predict(const InputSampleType& input) const = 0;
/** Classify all samples in InputListSample and fill TargetListSample with the associated label */
void PredictAll();
/**\name Classification model file manipulation */
//@{
/** Save the model to file */
virtual void Save(const std::string & filename, const std::string & name="") = 0;
/** Load the model from file */
virtual void Load(const std::string & filename, const std::string & name="") = 0;
//@}
/** Determine the file type. Returns true if this ImageIO can read the
* file specified. */
/**\name Classification model file compatibility tests */
//@{
/** Is the input model file readable and compatible with the corresponding classifier ? */
virtual bool CanReadFile(const std::string &) = 0;
/** Determine the file type. Returns true if this ImageIO can read the
* file specified. */
/** Is the input model file writable and compatible with the corresponding classifier ? */
virtual bool CanWriteFile(const std::string &) = 0;
//@}
/** Input accessors */
/**\name Input list of samples accessors */
//@{
itkSetObjectMacro(InputListSample,InputListSampleType);
itkGetObjectMacro(InputListSample,InputListSampleType);
//@}
/** Target accessors */
/**\name Classification output accessors */
//@{
/** Set the target labels (to be used before training) */
itkSetObjectMacro(TargetListSample,TargetListSampleType);
/** Get the target labels (to be used after PredictAll) */
itkGetObjectMacro(TargetListSample,TargetListSampleType);
//@}
protected:
/** Constructor */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment