OpenNN  2.2
Open Neural Networks Library
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
OpenNN::ModelSelection Class Reference

#include <model_selection.h>

Classes

struct  ModelSelectionResults
 

Public Types

enum  InputsSelectionType { NO_INPUTS_SELECTION, GROWING_INPUTS, PRUNING_INPUTS, GENETIC_ALGORITHM }
 
enum  OrderSelectionType { NO_ORDER_SELECTION, INCREMENTAL_ORDER, GOLDEN_SECTION, SIMULATED_ANNEALING }
 
enum  ThresholdSelectionType {
  NO_THRESHOLD_SELECTION, F1_SCORE_OPTIMIZATION, MATTHEW_CORRELATION, YOUDEN_INDEX,
  KAPPA_COEFFICIENT, ROC_CURVE_DISTANCE
}
 

Public Member Functions

 ModelSelection (void)
 
 ModelSelection (TrainingStrategy *)
 
 ModelSelection (const std::string &)
 
 ModelSelection (const tinyxml2::XMLDocument &)
 
virtual ~ModelSelection (void)
 
TrainingStrategyget_training_strategy_pointer (void) const
 
bool has_training_strategy (void) const
 
const OrderSelectionTypeget_order_selection_type (void) const
 
const InputsSelectionTypeget_inputs_selection_type (void) const
 
const ThresholdSelectionTypeget_threshold_selection_type (void) const
 
IncrementalOrderget_incremental_order_pointer (void) const
 
GoldenSectionOrderget_golden_section_order_pointer (void) const
 
SimulatedAnnealingOrderget_simulated_annealing_order_pointer (void) const
 
GrowingInputsget_growing_inputs_pointer (void) const
 
PruningInputsget_pruning_inputs_pointer (void) const
 
GeneticAlgorithmget_genetic_algorithm_pointer (void) const
 
F1ScoreOptimizationThresholdget_f1_score_optimization_threshold_pointer (void) const
 
MatthewCorrelationOptimizationThresholdget_matthew_correlation_optimization_threshold (void) const
 
YoudenIndexOptimizationThresholdget_youden_index_optimization_threshold (void) const
 
KappaCoefficientOptimizationThresholdget_kappa_coefficient_optimization_threshold (void) const
 
ROCCurveOptimizationThresholdget_roc_curve_optimization_threshold (void) const
 
void set_default (void)
 
void set_display (const bool &)
 
void set_training_strategy_pointer (TrainingStrategy *)
 
void set_order_selection_type (const OrderSelectionType &)
 
void set_order_selection_type (const std::string &)
 
void set_inputs_selection_type (const InputsSelectionType &)
 
void set_inputs_selection_type (const std::string &)
 
void set_threshold_selection_type (const ThresholdSelectionType &)
 
void set_threshold_selection_type (const std::string &)
 
void set_approximation (const bool &)
 
void destruct_order_selection (void)
 
void destruct_inputs_selection (void)
 
void destruct_threshold_selection (void)
 
void check (void) const
 
Vector< double > calculate_inputs_importance (void) const
 
ModelSelectionResults perform_order_selection (void) const
 
ModelSelectionResults perform_inputs_selection (void) const
 
ModelSelectionResults perform_threshold_selection (void) const
 
ModelSelectionResults perform_model_selection (void) const
 
tinyxml2::XMLDocument * to_XML (void) const
 
void from_XML (const tinyxml2::XMLDocument &)
 
void write_XML (tinyxml2::XMLPrinter &) const
 
void print (void) const
 
void save (const std::string &) const
 
void load (const std::string &)
 

Private Attributes

TrainingStrategytraining_strategy_pointer
 
IncrementalOrderincremental_order_pointer
 
GoldenSectionOrdergolden_section_order_pointer
 
SimulatedAnnealingOrdersimulated_annelaing_order_pointer
 
GrowingInputsgrowing_inputs_pointer
 
PruningInputspruning_inputs_pointer
 
GeneticAlgorithmgenetic_algorithm_pointer
 
F1ScoreOptimizationThresholdf1_score_optimization_threshold_pointer
 
MatthewCorrelationOptimizationThresholdmatthew_correlation_optimization_threshold_pointer
 
YoudenIndexOptimizationThresholdyouden_index_optimization_threshold_pointer
 
KappaCoefficientOptimizationThresholdkappa_coefficient_optimization_threshold_pointer
 
ROCCurveOptimizationThresholdroc_curve_optimization_threshold_pointer
 
OrderSelectionType order_selection_type
 
InputsSelectionType inputs_selection_type
 
ThresholdSelectionType threshold_selection_type
 
bool display
 

Detailed Description

This class represents the concept of model selection algorithm. It is used for finding a network architecture with maximum selection capabilities.

Definition at line 54 of file model_selection.h.

Constructor & Destructor Documentation

◆ ModelSelection() [1/3]

OpenNN::ModelSelection::ModelSelection ( TrainingStrategy new_training_strategy_pointer)
explicit

Training strategy constructor.

Parameters
new_training_strategy_pointerPointer to a training strategy object.

Definition at line 48 of file model_selection.cpp.

◆ ModelSelection() [2/3]

OpenNN::ModelSelection::ModelSelection ( const std::string &  file_name)
explicit

File constructor.

Parameters
file_nameName of XML model selection file.

Definition at line 71 of file model_selection.cpp.

◆ ModelSelection() [3/3]

OpenNN::ModelSelection::ModelSelection ( const tinyxml2::XMLDocument &  model_selection_document)
explicit

XML constructor.

Parameters
model_selection_documentPointer to a TinyXML document containing the model selection data.

Definition at line 94 of file model_selection.cpp.

Member Function Documentation

◆ from_XML()

void OpenNN::ModelSelection::from_XML ( const tinyxml2::XMLDocument &  document)

Loads the members of this model selection object from a XML document.

Parameters
documentXML document of the TinyXML library.

Definition at line 2639 of file model_selection.cpp.

◆ has_training_strategy()

bool OpenNN::ModelSelection::has_training_strategy ( void  ) const

Returns true if this model selection has a training strategy associated, and false otherwise.

Definition at line 171 of file model_selection.cpp.

◆ load()

void OpenNN::ModelSelection::load ( const std::string &  file_name)

Loads the model selection members from a XML file.

Parameters
file_nameName of model selection XML file.

Definition at line 2914 of file model_selection.cpp.

◆ perform_inputs_selection()

ModelSelection::ModelSelectionResults OpenNN::ModelSelection::perform_inputs_selection ( void  ) const

Perform the inputs selection, returns a structure with the results of the inputs selection. It also set the neural network of the training strategy pointer with the optimum parameters.

Definition at line 1953 of file model_selection.cpp.

◆ perform_model_selection()

ModelSelection::ModelSelectionResults OpenNN::ModelSelection::perform_model_selection ( void  ) const
Todo:
Perform inputs selection and order selection.

Definition at line 2107 of file model_selection.cpp.

◆ perform_order_selection()

ModelSelection::ModelSelectionResults OpenNN::ModelSelection::perform_order_selection ( void  ) const

Perform the order selection, returns a structure with the results of the order selection It also set the neural network of the training strategy pointer with the optimum parameters

Definition at line 1887 of file model_selection.cpp.

◆ perform_threshold_selection()

ModelSelection::ModelSelectionResults OpenNN::ModelSelection::perform_threshold_selection ( void  ) const

Perform the threshold selection, returns a structure with the results of the threshold selection. It also set the neural network with the optimum threshold.

Definition at line 2022 of file model_selection.cpp.

◆ save()

void OpenNN::ModelSelection::save ( const std::string &  file_name) const

Saves the model selection members to a XML file.

Parameters
file_nameName of model selection XML file.

Definition at line 2899 of file model_selection.cpp.

◆ set_approximation()

void OpenNN::ModelSelection::set_approximation ( const bool &  new_approximation)

Sets a new regression value. If it is set to true the problem will be taken as a approximation; if it is set to false the problem will be taken as a classification.

Parameters
new_approximationApproximation value.

Definition at line 732 of file model_selection.cpp.

◆ set_display()

void OpenNN::ModelSelection::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 329 of file model_selection.cpp.

◆ set_inputs_selection_type() [1/2]

void OpenNN::ModelSelection::set_inputs_selection_type ( const InputsSelectionType new_inputs_selection_type)

Sets a new method for selecting the inputs which have more impact on the targets.

Parameters
new_inputs_selection_typeMethod for selecting the inputs (NO_INPUTS_SELECTION, GROWING_INPUTS, PRUNING_INPUTS, GENETIC_ALGORITHM).

Definition at line 536 of file model_selection.cpp.

◆ set_inputs_selection_type() [2/2]

void OpenNN::ModelSelection::set_inputs_selection_type ( const std::string &  new_inputs_selection_type)

Sets a new inputs selection algorithm from a string.

Parameters
new_inputs_selection_typeString with the inputs selection type.

Definition at line 588 of file model_selection.cpp.

◆ set_order_selection_type() [1/2]

void OpenNN::ModelSelection::set_order_selection_type ( const OrderSelectionType new_order_selection_type)

Sets a new method for selecting the order which have more impact on the targets.

Parameters
new_order_selection_typeMethod for selecting the order (NO_ORDER_SELECTION, INCREMENTAL_ORDER, GOLDEN_SECTION, SIMULATED_ANNEALING).

Definition at line 447 of file model_selection.cpp.

◆ set_order_selection_type() [2/2]

void OpenNN::ModelSelection::set_order_selection_type ( const std::string &  new_order_selection_type)

Sets a new order selection algorithm from a string.

Parameters
new_order_selection_typeString with the order selection type.

Definition at line 501 of file model_selection.cpp.

◆ set_threshold_selection_type() [1/2]

void OpenNN::ModelSelection::set_threshold_selection_type ( const ThresholdSelectionType new_threshold_selection_type)

Sets a new method for selecting the threshold to improve the final model.

Parameters
new_threshold_selection_typeMethod for selecting the threshold.

Definition at line 623 of file model_selection.cpp.

◆ set_threshold_selection_type() [2/2]

void OpenNN::ModelSelection::set_threshold_selection_type ( const std::string &  new_threshold_selection_type)

Sets a new threshold selection algorithm from a string.

Parameters
new_threshold_selection_typeString with the threshold selection type.

Definition at line 687 of file model_selection.cpp.

◆ set_training_strategy_pointer()

void OpenNN::ModelSelection::set_training_strategy_pointer ( TrainingStrategy new_training_strategy_pointer)

Sets a new training strategy pointer.

Parameters
new_training_strategy_pointerPointer to a training strategy object.

Definition at line 780 of file model_selection.cpp.

◆ to_XML()

tinyxml2::XMLDocument * OpenNN::ModelSelection::to_XML ( void  ) const

Serializes the model selection object into a XML document of the TinyXML library. See the OpenNN manual for more information about the format of this document.

Definition at line 2122 of file model_selection.cpp.

◆ write_XML()

void OpenNN::ModelSelection::write_XML ( tinyxml2::XMLPrinter &  file_stream) const

Serializes the model selection object into a XML document of the TinyXML library without keep the DOM tree in memory. See the OpenNN manual for more information about the format of this document.

Definition at line 2408 of file model_selection.cpp.


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