InputsSelection Class Referenceabstract

This abstract class represents the concept of inputs selection algorithm for a ModelSelection. More...

#include <inputs_selection.h>

Inheritance diagram for InputsSelection:
GeneticAlgorithm GrowingInputs PruningInputs

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...
 
TrainingStrategyget_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

TrainingStrategytraining_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})}
 

Detailed Description

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.

Member Enumeration Documentation

◆ StoppingCondition

enum class StoppingCondition
strong

Enumeration of all possibles condition of stop for the algorithms.

Definition at line 57 of file inputs_selection.h.

Constructor & Destructor Documentation

◆ InputsSelection() [1/2]

InputsSelection ( )
explicit

Default constructor.

Definition at line 16 of file inputs_selection.cpp.

◆ InputsSelection() [2/2]

InputsSelection ( TrainingStrategy new_training_strategy_pointer)
explicit

Training strategy constructor.

Parameters
new_training_strategy_pointerPointer to a trainig strategy object.

Definition at line 26 of file inputs_selection.cpp.

◆ ~InputsSelection()

~InputsSelection ( )
virtual

Destructor.

Definition at line 35 of file inputs_selection.cpp.

Member Function Documentation

◆ check()

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.

◆ get_display()

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.

◆ get_input_index()

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.

Parameters
usesVector of the uses of the variables.
inputs_numberIndex of the input to find.

Definition at line 459 of file inputs_selection.cpp.

◆ get_maximum_correlation()

const type & get_maximum_correlation ( ) const

Return the maximum correlation for the algorithm.

Definition at line 121 of file inputs_selection.cpp.

◆ get_maximum_iterations_number()

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.

◆ get_maximum_time()

const type & get_maximum_time ( ) const

Returns the maximum time in the inputs selection algorithm.

Definition at line 113 of file inputs_selection.cpp.

◆ get_minimum_correlation()

const type & get_minimum_correlation ( ) const

Return the minimum correlation for the algorithm.

Definition at line 129 of file inputs_selection.cpp.

◆ get_selection_error_goal()

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.

◆ get_training_strategy_pointer()

TrainingStrategy * get_training_strategy_pointer ( ) const

Returns a pointer to the training strategy object.

Definition at line 42 of file inputs_selection.cpp.

◆ get_trials_number()

const Index & get_trials_number ( ) const

Returns the number of trials for each network architecture.

Definition at line 80 of file inputs_selection.cpp.

◆ has_training_strategy()

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.

◆ perform_inputs_selection()

virtual InputsSelectionResults perform_inputs_selection ( )
pure virtual

Performs the inputs selection for a neural network.

Implemented in GeneticAlgorithm, GrowingInputs, and PruningInputs.

◆ set()

void set ( TrainingStrategy new_training_strategy_pointer)

Sets a new training strategy pointer.

Parameters
new_training_strategy_pointerPointer to a training strategy object.

Definition at line 138 of file inputs_selection.cpp.

◆ set_default()

void set_default ( )

Sets the members of the inputs selection object to their default values.

Definition at line 146 of file inputs_selection.cpp.

◆ set_display()

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.

Parameters
new_displayDisplay value.

Definition at line 191 of file inputs_selection.cpp.

◆ set_maximum_correlation()

void set_maximum_correlation ( const type &  new_maximum_correlation)

Sets the maximum value for the correlations in the inputs selection algorithm.

Parameters
new_maximum_correlationMaximum value of the correlations.

Definition at line 257 of file inputs_selection.cpp.

◆ set_maximum_epochs_number()

void set_maximum_epochs_number ( const Index &  new_maximum_epochs_number)

Sets the maximum iterations number for the inputs selection algorithm.

Parameters
new_maximum_epochs_numberMaximum number of epochs.

Definition at line 224 of file inputs_selection.cpp.

◆ set_maximum_time()

void set_maximum_time ( const type &  new_maximum_time)

Sets the maximum time for the inputs selection algorithm.

Parameters
new_maximum_timeMaximum time for the algorithm.

Definition at line 233 of file inputs_selection.cpp.

◆ set_minimum_correlation()

void set_minimum_correlation ( const type &  new_minimum_correlation)

Sets the minimum value for the correlations in the inputs selection algorithm.

Parameters
new_minimum_correlationMinimum value of the correlations.

Definition at line 281 of file inputs_selection.cpp.

◆ set_selection_error_goal()

void set_selection_error_goal ( const type &  new_selection_error_goal)

Sets the selection error goal for the inputs selection algorithm.

Parameters
new_selection_error_goalGoal of the selection error.

Definition at line 200 of file inputs_selection.cpp.

◆ set_trials_number()

void set_trials_number ( const Index &  new_trials_number)

Sets the number of times that each different neural network is to be trained.

Parameters
new_trials_numberNumber of trials for each set of parameters.

Definition at line 166 of file inputs_selection.cpp.

◆ write_stopping_condition()

string write_stopping_condition ( const TrainingResults results) const

Return a string with the stopping condition of the training depending on the training method.

Parameters
resultsResults of the perform_training method.

Definition at line 305 of file inputs_selection.cpp.

◆ write_time()

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.

Member Data Documentation

◆ display

bool display = true
protected

Display messages to screen.

Definition at line 128 of file inputs_selection.h.

◆ maximum_correlation

type maximum_correlation
protected

Maximum value for the correlations.

Definition at line 142 of file inputs_selection.h.

◆ maximum_epochs_number

Index maximum_epochs_number
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.

◆ maximum_time

type maximum_time
protected

Maximum selection algorithm time. It is used as a stopping criterion.

Definition at line 150 of file inputs_selection.h.

◆ minimum_correlation

type minimum_correlation
protected

Minimum value for the correlations.

Definition at line 146 of file inputs_selection.h.

◆ original_input_columns_indices

Tensor<Index, 1> original_input_columns_indices
protected

Definition at line 119 of file inputs_selection.h.

◆ original_target_columns_indices

Tensor<Index, 1> original_target_columns_indices
protected

Definition at line 120 of file inputs_selection.h.

◆ rows_sum

const Eigen::array<int, 1> rows_sum = {Eigen::array<int, 1>({1})}
protected

Definition at line 152 of file inputs_selection.h.

◆ selection_error_goal

type selection_error_goal
protected

Goal value for the selection error. It is used as a stopping criterion.

Definition at line 134 of file inputs_selection.h.

◆ training_strategy_pointer

TrainingStrategy* training_strategy_pointer = nullptr
protected

Pointer to a training strategy object.

Definition at line 117 of file inputs_selection.h.

◆ trials_number

Index trials_number = 1
protected

Number of trials for each neural network.

Definition at line 124 of file inputs_selection.h.


The documentation for this class was generated from the following files: