This abstract class represents the concept of inputs selection algorithm for a ModelSelection. More...
#include <inputs_selection.h>
Public Types | |
enum class | StoppingCondition { MaximumTime , SelectionErrorGoal , MaximumInputs , MinimumInputs , MaximumEpochs , MaximumSelectionFailures , CorrelationGoal } |
Enumeration of all possibles condition of stop for the algorithms. More... | |
Public Member Functions | |
InputsSelection () | |
Default constructor. More... | |
InputsSelection (TrainingStrategy *) | |
virtual | ~InputsSelection () |
Destructor. More... | |
TrainingStrategy * | get_training_strategy_pointer () const |
Returns a pointer to the training strategy object. More... | |
bool | has_training_strategy () const |
Returns true if this inputs selection algorithm has a training strategy associated, and false otherwise. More... | |
const Index & | get_trials_number () const |
Returns the number of trials for each network architecture. More... | |
const bool & | get_display () const |
const type & | get_selection_error_goal () const |
Returns the goal for the selection error in the inputs selection algorithm. More... | |
const Index & | get_maximum_iterations_number () const |
Returns the maximum number of iterations in the inputs selection algorithm. More... | |
const type & | get_maximum_time () const |
Returns the maximum time in the inputs selection algorithm. More... | |
const type & | get_maximum_correlation () const |
Return the maximum correlation for the algorithm. More... | |
const type & | get_minimum_correlation () const |
Return the minimum correlation for the algorithm. More... | |
const type & | get_tolerance () const |
void | set (TrainingStrategy *) |
void | set_default () |
Sets the members of the inputs selection object to their default values. More... | |
void | set_trials_number (const Index &) |
void | set_display (const bool &) |
void | set_selection_error_goal (const type &) |
void | set_maximum_epochs_number (const Index &) |
void | set_maximum_time (const type &) |
void | set_maximum_correlation (const type &) |
void | set_minimum_correlation (const type &) |
string | write_stopping_condition (const TrainingResults &) const |
void | check () const |
Checks that the different pointers needed for performing the inputs selection are not nullptr. More... | |
Index | get_input_index (const Tensor< DataSet::VariableUse, 1 > &, const Index &) |
virtual InputsSelectionResults | perform_inputs_selection ()=0 |
Performs the inputs selection for a neural network. More... | |
const string | write_time (const type &) const |
Writes the time from seconds in format HH:mm:ss. More... | |
Protected Attributes | |
TrainingStrategy * | training_strategy_pointer = nullptr |
Pointer to a training strategy object. More... | |
Tensor< Index, 1 > | original_input_columns_indices |
Tensor< Index, 1 > | original_target_columns_indices |
Index | trials_number = 1 |
Number of trials for each neural network. More... | |
bool | display = true |
Display messages to screen. More... | |
type | selection_error_goal |
Goal value for the selection error. It is used as a stopping criterion. More... | |
Index | maximum_epochs_number |
Maximum number of epochs to perform_inputs_selection. It is used as a stopping criterion. More... | |
type | maximum_correlation |
Maximum value for the correlations. More... | |
type | minimum_correlation |
Minimum value for the correlations. More... | |
type | maximum_time |
Maximum selection algorithm time. It is used as a stopping criterion. More... | |
const Eigen::array< int, 1 > | rows_sum = {Eigen::array<int, 1>({1})} |
This abstract class represents the concept of inputs selection algorithm for a ModelSelection.
Any derived class must implement the perform_inputs_selection() method.
Neural Designer "Model Selection Algorithms in Predictive Analytics." https://www.neuraldesigner.com/blog/model-selection
Definition at line 39 of file inputs_selection.h.
|
strong |
Enumeration of all possibles condition of stop for the algorithms.
Definition at line 57 of file inputs_selection.h.
|
explicit |
Default constructor.
Definition at line 16 of file inputs_selection.cpp.
|
explicit |
Training strategy constructor.
new_training_strategy_pointer | Pointer to a trainig strategy object. |
Definition at line 26 of file inputs_selection.cpp.
|
virtual |
Destructor.
Definition at line 35 of file inputs_selection.cpp.
void check | ( | ) | const |
Checks that the different pointers needed for performing the inputs selection are not nullptr.
Definition at line 313 of file inputs_selection.cpp.
const bool & get_display | ( | ) | const |
Returns true if messages from this class can be displayed on the screen, or false if messages from this class can't be displayed on the screen.
Definition at line 89 of file inputs_selection.cpp.
Index get_input_index | ( | const Tensor< DataSet::VariableUse, 1 > & | uses, |
const Index & | inputs_number | ||
) |
Return the index of uses where is the(inputs_number)-th input.
uses | Vector of the uses of the variables. |
inputs_number | Index of the input to find. |
Definition at line 459 of file inputs_selection.cpp.
const type & get_maximum_correlation | ( | ) | const |
Return the maximum correlation for the algorithm.
Definition at line 121 of file inputs_selection.cpp.
const Index & get_maximum_iterations_number | ( | ) | const |
Returns the maximum number of iterations in the inputs selection algorithm.
Definition at line 105 of file inputs_selection.cpp.
const type & get_maximum_time | ( | ) | const |
Returns the maximum time in the inputs selection algorithm.
Definition at line 113 of file inputs_selection.cpp.
const type & get_minimum_correlation | ( | ) | const |
Return the minimum correlation for the algorithm.
Definition at line 129 of file inputs_selection.cpp.
const type & get_selection_error_goal | ( | ) | const |
Returns the goal for the selection error in the inputs selection algorithm.
Definition at line 97 of file inputs_selection.cpp.
TrainingStrategy * get_training_strategy_pointer | ( | ) | const |
Returns a pointer to the training strategy object.
Definition at line 42 of file inputs_selection.cpp.
const Index & get_trials_number | ( | ) | const |
Returns the number of trials for each network architecture.
Definition at line 80 of file inputs_selection.cpp.
bool has_training_strategy | ( | ) | const |
Returns true if this inputs selection algorithm has a training strategy associated, and false otherwise.
Definition at line 65 of file inputs_selection.cpp.
|
pure virtual |
Performs the inputs selection for a neural network.
Implemented in GeneticAlgorithm, GrowingInputs, and PruningInputs.
void set | ( | TrainingStrategy * | new_training_strategy_pointer | ) |
Sets a new training strategy pointer.
new_training_strategy_pointer | Pointer to a training strategy object. |
Definition at line 138 of file inputs_selection.cpp.
void set_default | ( | ) |
Sets the members of the inputs selection object to their default values.
Definition at line 146 of file inputs_selection.cpp.
void set_display | ( | const bool & | new_display | ) |
Sets a new display value. If it is set to true messages from this class are to be displayed on the screen; if it is set to false messages from this class are not to be displayed on the screen.
new_display | Display value. |
Definition at line 191 of file inputs_selection.cpp.
void set_maximum_correlation | ( | const type & | new_maximum_correlation | ) |
Sets the maximum value for the correlations in the inputs selection algorithm.
new_maximum_correlation | Maximum value of the correlations. |
Definition at line 257 of file inputs_selection.cpp.
void set_maximum_epochs_number | ( | const Index & | new_maximum_epochs_number | ) |
Sets the maximum iterations number for the inputs selection algorithm.
new_maximum_epochs_number | Maximum number of epochs. |
Definition at line 224 of file inputs_selection.cpp.
void set_maximum_time | ( | const type & | new_maximum_time | ) |
Sets the maximum time for the inputs selection algorithm.
new_maximum_time | Maximum time for the algorithm. |
Definition at line 233 of file inputs_selection.cpp.
void set_minimum_correlation | ( | const type & | new_minimum_correlation | ) |
Sets the minimum value for the correlations in the inputs selection algorithm.
new_minimum_correlation | Minimum value of the correlations. |
Definition at line 281 of file inputs_selection.cpp.
void set_selection_error_goal | ( | const type & | new_selection_error_goal | ) |
Sets the selection error goal for the inputs selection algorithm.
new_selection_error_goal | Goal of the selection error. |
Definition at line 200 of file inputs_selection.cpp.
void set_trials_number | ( | const Index & | new_trials_number | ) |
Sets the number of times that each different neural network is to be trained.
new_trials_number | Number of trials for each set of parameters. |
Definition at line 166 of file inputs_selection.cpp.
string write_stopping_condition | ( | const TrainingResults & | results | ) | const |
Return a string with the stopping condition of the training depending on the training method.
results | Results of the perform_training method. |
Definition at line 305 of file inputs_selection.cpp.
const string write_time | ( | const type & | time | ) | const |
Writes the time from seconds in format HH:mm:ss.
Definition at line 412 of file inputs_selection.cpp.
|
protected |
Display messages to screen.
Definition at line 128 of file inputs_selection.h.
|
protected |
Maximum value for the correlations.
Definition at line 142 of file inputs_selection.h.
|
protected |
Maximum number of epochs to perform_inputs_selection. It is used as a stopping criterion.
Definition at line 138 of file inputs_selection.h.
|
protected |
Maximum selection algorithm time. It is used as a stopping criterion.
Definition at line 150 of file inputs_selection.h.
|
protected |
Minimum value for the correlations.
Definition at line 146 of file inputs_selection.h.
|
protected |
Definition at line 119 of file inputs_selection.h.
|
protected |
Definition at line 120 of file inputs_selection.h.
|
protected |
Definition at line 152 of file inputs_selection.h.
|
protected |
Goal value for the selection error. It is used as a stopping criterion.
Definition at line 134 of file inputs_selection.h.
|
protected |
Pointer to a training strategy object.
Definition at line 117 of file inputs_selection.h.
|
protected |
Number of trials for each neural network.
Definition at line 124 of file inputs_selection.h.