![]() |
UFJF - Machine Learning Toolkit
0.51.8
|
Public Member Functions | |
Learner (DataPointer< T > _samples) | |
Learner (const Learner< T > &learner) | |
virtual bool | train ()=0 |
Function that execute the training phase of a Learner. More... | |
virtual double | evaluate (const Point< T > &p, bool raw_value=false)=0 |
Returns the class of a feature point based on the trained Learner. More... | |
virtual mltk::Point< double > | batchEvaluate (const Data< T > &data) |
evaluate a batch of points. More... | |
virtual std::string | getFormulationString ()=0 |
getFormulationString Returns a string that represents the formulation of the learner (Primal or Dual). More... | |
auto | getSamples () |
Get the Data used by the learner. More... | |
double | getElapsedTime () const |
Get the elapsed time in the training phase of the Learner. More... | |
int | getCtot () const |
Get the total number of updates of the Learner. More... | |
int | getSteps () const |
getSteps Returns the number of steps through the data by the Learner. More... | |
int | getUpdates () const |
getUpdates Returns the number of updates needed to get to the the solution. More... | |
double | getMaxTime () const |
getMaxTime Returns the maximum running time in the training phase of the Learner. More... | |
double | getPredictionProbability () const |
Get the probability of the last prediction. More... | |
void | setSeed (const size_t _seed) |
Set the seed to be used by the learner. More... | |
virtual void | setSamples (const Data< T > &data) |
setSamples Set the samples used by the Learner. More... | |
virtual void | setSamples (DataPointer< T > data) |
setSamples Set the samples used by the Learner. More... | |
void | setTimer (Timer _timer) |
setTimer Set the timer used by the Learner. More... | |
void | setSteps (int _steps) |
Set the partial number of steps used in the training phase of the Learner. More... | |
void | setCtot (int _ctot) |
Set the partial number of updates of the Learner. More... | |
void | setVerbose (int _verbose) |
Set the level of verbose. More... | |
void | setStartTime (double stime) |
setStartTime Set the initial time of the Learner. More... | |
void | setMaxTime (double maxtime) |
Set the max time of execution. More... | |
void | setEPS (double eps) |
setEPS Set the precision of the Learner. More... | |
void | setMaxIterations (int max_it) |
setMaxIterations Set the max number of iterations of the Learner. More... | |
void | setMaxEpochs (int MAX_EPOCHS) |
Set the max number of epochs for the learner training. More... | |
void | setMaxUpdates (int max_up) |
setMaxIterations Set the max number of updates of the Learner. More... | |
void | setLearningRate (double learning_rate) |
Set the learning rate of the Learner. More... | |
Protected Attributes | |
std::shared_ptr< Data< T > > | samples |
Samples used in the model training. More... | |
double | rate = 0.5f |
Learning rate. More... | |
double | start_time = 0.0f |
Initial time. More... | |
double | max_time = 110 |
Maximum time of training. More... | |
int | steps = 0 |
Number of steps in the data. More... | |
int | ctot = 0 |
Number of updates of the weights. More... | |
double | EPS = 0.0000001 |
Max precision. More... | |
double | MIN_INC = 1.001 |
Minimun Increment. More... | |
int | MAX_IT = 1E9 |
Max number of iterations. More... | |
int | MAX_UP = 1E9 |
Max number of updates. More... | |
int | MAX_EPOCH = 1E9 |
int | verbose = 1 |
Verbose level of the output. More... | |
Timer | timer = Timer() |
Timer used to measure the time elapsed in the execution of a Learner. More... | |
size_t | seed = 0 |
seed for random operations. More... | |
double | pred_prob = 1.0 |
|
virtual |
evaluate a batch of points.
data | dataset containing points for evaluation. |
|
pure virtual |
Returns the class of a feature point based on the trained Learner.
p | Point to be evaluated. |
Implemented in mltk::regressor::PrimalRegressor< T >, mltk::regressor::KNNRegressor< T, Callable >, mltk::regressor::DualRegressor< T >, mltk::ensemble::VotingClassifier< T >, mltk::ensemble::PerceptronCommittee< T >, mltk::ensemble::BaggingClassifier< T >, mltk::ensemble::AutoWeightedVoting< T >, mltk::ensemble::AdaBoostClassifier< T >, mltk::clusterer::KMeans< T, Callable >, mltk::classifier::PrimalClassifier< T >, mltk::classifier::PerceptronFixedMarginPrimal< T >, mltk::classifier::PerceptronPrimal< T >, mltk::classifier::OneVsOne< T >, mltk::classifier::OneVsAll< T >, mltk::classifier::KNNClassifier< T, Callable >, mltk::classifier::IMApFixedMargin< T >, mltk::classifier::IMAp< T >, mltk::classifier::DualClassifier< T >, and mltk::classifier::BalancedPerceptron< T >.
|
inline |
Get the total number of updates of the Learner.
|
inline |
Get the elapsed time in the training phase of the Learner.
|
pure virtual |
getFormulationString Returns a string that represents the formulation of the learner (Primal or Dual).
Implemented in mltk::regressor::PrimalRegressor< T >, mltk::regressor::PrimalRegressor< double >, mltk::regressor::KNNRegressor< T, Callable >, mltk::regressor::DualRegressor< T >, mltk::ensemble::VotingClassifier< T >, mltk::ensemble::PerceptronCommittee< T >, mltk::ensemble::BaggingClassifier< T >, mltk::ensemble::AutoWeightedVoting< T >, mltk::ensemble::AdaBoostClassifier< T >, mltk::clusterer::KMeans< T, Callable >, mltk::classifier::PrimalClassifier< T >, mltk::classifier::PrimalClassifier< double >, mltk::classifier::BalancedPerceptron< T >, mltk::classifier::OneVsOne< T >, mltk::classifier::OneVsAll< T >, mltk::classifier::DualClassifier< T >, and mltk::classifier::DualClassifier< double >.
|
inline |
getMaxTime Returns the maximum running time in the training phase of the Learner.
|
inline |
Get the probability of the last prediction.
|
inline |
|
inline |
getSteps Returns the number of steps through the data by the Learner.
|
inline |
getUpdates Returns the number of updates needed to get to the the solution.
|
inline |
Set the partial number of updates of the Learner.
_ctot | Number of updates. |
|
inline |
setEPS Set the precision of the Learner.
eps | Precision. |
|
inline |
Set the learning rate of the Learner.
learning_rate | Learning rate. |
|
inline |
Set the max number of epochs for the learner training.
MAX_EPOCHS | Max number of epochs. |
|
inline |
setMaxIterations Set the max number of iterations of the Learner.
max_it | Number max of iterations. |
|
inline |
Set the max time of execution.
maxtime | Max time. |
|
inline |
setMaxIterations Set the max number of updates of the Learner.
MAX_IT | Number max of updates. |
|
inlinevirtual |
setSamples Set the samples used by the Learner.
data | Samples to be used. |
|
inlinevirtual |
setSamples Set the samples used by the Learner.
data | Samples to be used. |
Reimplemented in mltk::ensemble::Ensemble< T >.
|
inline |
Set the seed to be used by the learner.
_seed | Seed to be used. |
|
inline |
setStartTime Set the initial time of the Learner.
stime | Initial time. |
|
inline |
Set the partial number of steps used in the training phase of the Learner.
_steps | Number of steps. |
|
inline |
|
inline |
Set the level of verbose.
_verbose | level of verbose. |
|
pure virtual |
Function that execute the training phase of a Learner.
Implemented in mltk::regressor::LMSPrimal< T >, mltk::regressor::KNNRegressor< T, Callable >, mltk::ensemble::VotingClassifier< T >, mltk::ensemble::PerceptronCommittee< T >, mltk::ensemble::BaggingClassifier< T >, mltk::ensemble::AutoWeightedVoting< T >, mltk::ensemble::AdaBoostClassifier< T >, mltk::clusterer::KMeans< T, Callable >, mltk::classifier::SMO< T >, mltk::classifier::BalancedPerceptron< T >, mltk::classifier::PerceptronFixedMarginDual< T >, mltk::classifier::PerceptronDual< T >, mltk::classifier::PerceptronFixedMarginPrimal< T >, mltk::classifier::PerceptronPrimal< T >, mltk::classifier::OneVsOne< T >, mltk::classifier::OneVsAll< T >, mltk::classifier::KNNClassifier< T, Callable >, mltk::classifier::IMADual< T >, mltk::classifier::IMApFixedMargin< T >, and mltk::classifier::IMAp< T >.
|
protected |
Number of updates of the weights.
|
protected |
Max precision.
|
protected |
Max number of iterations.
|
protected |
Maximum time of training.
|
protected |
Max number of updates.
|
protected |
Minimun Increment.
|
protected |
Learning rate.
|
protected |
Samples used in the model training.
|
protected |
seed for random operations.
|
protected |
Initial time.
|
protected |
Number of steps in the data.
|
protected |
|
protected |
Verbose level of the output.