Superclass of weighted supervised learning algorithms. More...
#include <shark/Algorithms/Trainers/AbstractWeightedTrainer.h>
Public Types | |
typedef base_type::ModelType | ModelType |
typedef base_type::InputType | InputType |
typedef base_type::LabelType | LabelType |
typedef base_type::DatasetType | DatasetType |
typedef WeightedLabeledData< InputType, LabelType > | WeightedDatasetType |
Public Types inherited from shark::AbstractTrainer< Model, LabelTypeT > | |
typedef Model | ModelType |
typedef ModelType::InputType | InputType |
typedef LabelTypeT | LabelType |
typedef LabeledData< InputType, LabelType > | DatasetType |
Public Member Functions | |
virtual void | train (ModelType &model, WeightedDatasetType const &dataset)=0 |
Executes the algorithm and trains a model on the given weighted data. More... | |
virtual void | train (ModelType &model, DatasetType const &dataset) |
Executes the algorithm and trains a model on the given unweighted data. More... | |
Public Member Functions inherited from shark::INameable | |
virtual | ~INameable () |
virtual std::string | name () const |
returns the name of the object More... | |
Public Member Functions inherited from shark::ISerializable | |
virtual | ~ISerializable () |
Virtual d'tor. More... | |
virtual void | read (InArchive &archive) |
Read the component from the supplied archive. More... | |
virtual void | write (OutArchive &archive) const |
Write the component to the supplied archive. More... | |
void | load (InArchive &archive, unsigned int version) |
Versioned loading of components, calls read(...). More... | |
void | save (OutArchive &archive, unsigned int version) const |
Versioned storing of components, calls write(...). More... | |
BOOST_SERIALIZATION_SPLIT_MEMBER () | |
Superclass of weighted supervised learning algorithms.
When all weights are integral values there is a simple interpretation of the weights as the multiplicity of a point. Thus training with a dataset with duplicate points is the same as counting the duplicates and run the algorithm with a weighted dataset where all points are unique and have their weight is the multiplicity.
Definition at line 60 of file AbstractWeightedTrainer.h.
typedef base_type::DatasetType shark::AbstractWeightedTrainer< Model, LabelTypeT >::DatasetType |
Definition at line 68 of file AbstractWeightedTrainer.h.
typedef base_type::InputType shark::AbstractWeightedTrainer< Model, LabelTypeT >::InputType |
Definition at line 66 of file AbstractWeightedTrainer.h.
typedef base_type::LabelType shark::AbstractWeightedTrainer< Model, LabelTypeT >::LabelType |
Definition at line 67 of file AbstractWeightedTrainer.h.
typedef base_type::ModelType shark::AbstractWeightedTrainer< Model, LabelTypeT >::ModelType |
Definition at line 65 of file AbstractWeightedTrainer.h.
typedef WeightedLabeledData<InputType, LabelType> shark::AbstractWeightedTrainer< Model, LabelTypeT >::WeightedDatasetType |
Definition at line 69 of file AbstractWeightedTrainer.h.
|
pure virtual |
Executes the algorithm and trains a model on the given weighted data.
Implemented in shark::LinearSAGTrainer< InputType, LabelType >.
Referenced by shark::AbstractWeightedTrainer< KernelClassifier< InputType > >::train(), and shark::AbstractWeightedUnsupervisedTrainer< Model >::train().
|
inlinevirtual |
Executes the algorithm and trains a model on the given unweighted data.
This method behaves as using train with a weighted dataset where all weights are equal. The default implementation just creates such a dataset and executes the weighted version of the algorithm.
Implements shark::AbstractTrainer< Model, LabelTypeT >.
Definition at line 79 of file AbstractWeightedTrainer.h.