14 #ifndef __VARIABLES_H__
15 #define __VARIABLES_H__
41 #include "../tinyxml2/tinyxml2.h"
65 explicit Variables(
const size_t&,
const size_t&);
69 explicit Variables(
const tinyxml2::XMLDocument&);
91 enum Use{Input, Target, Unused};
128 return(
items.size());
131 bool empty(
void)
const;
146 std::string
write_use(
const size_t&)
const;
148 bool is_used(
const size_t&)
const;
156 const std::string&
get_name(
const size_t&)
const;
161 const std::string&
get_unit(
const size_t&)
const;
171 void set(
const size_t&);
172 void set(
const size_t&,
const size_t&);
173 void set(
const tinyxml2::XMLDocument&);
189 void set_use(
const size_t&,
const std::string&);
199 void set_name(
const size_t&,
const std::string&);
202 void set_units(
const size_t&,
const std::string&);
232 tinyxml2::XMLDocument*
to_XML(
void)
const;
233 void from_XML(
const tinyxml2::XMLDocument&);
238 static std::string
prepend(
const std::string&,
const std::string&);
virtual ~Variables(void)
Destructor.
const std::string & get_description(const size_t &) const
Use
This enumeration represents the possible uses of a variable (input, target or unused).
std::string units
Units of a variable.
void set_name(const size_t &, const std::string &)
Vector< std::string > arrange_inputs_name(void) const
Returns the names of the input variables in the data set.
const std::string & get_name(const size_t &) const
void set_target(void)
Sets all the variables in the data set as target variables.
Vector< std::string > arrange_units(void) const
Returns the units of all the variables in the data set.
void convert_time_series(const size_t &)
Vector< std::string > arrange_inputs_units(void) const
Returns the units of the input variables in the data set.
bool empty(void) const
Returns true if the number of variables is zero, and false otherwise.
void set_descriptions(const Vector< std::string > &)
static std::string unsigned_to_string(const size_t &)
Returns the string representation of number of type size_t.
Matrix< std::string > arrange_targets_information(void) const
Vector< size_t > arrange_targets_indices(void) const
Returns the indices of the target variables.
static std::string prepend(const std::string &, const std::string &)
Prepends the string pre to the beginning of the string str and returns the whole string.
const bool & get_display(void) const
Matrix< std::string > arrange_information(void) const
void set_variables_number(const size_t &)
void set_display(const bool &)
void set_default_uses(void)
void set_items(const Vector< Item > &)
void set_input(void)
Sets all the variables in the data set as input variables.
Vector< std::string > arrange_targets_units(void) const
Returns the units of the target variables in the data set.
void set_uses(const Vector< Use > &)
tinyxml2::XMLDocument * to_XML(void) const
void set(void)
Sets a variables object with zero variables.
size_t count_used_variables_number(void) const
Returns the number of variables which are either input or target.
bool has_names(void) const
Returns true if all the variables have been named, and false otherwise.
Vector< std::string > arrange_targets_description(void) const
Returns the description of the target variables in the data set.
void from_XML(const tinyxml2::XMLDocument &)
bool display
Display messages to screen.
void set_description(const size_t &, const std::string &)
size_t count_inputs_number(void) const
Returns the number of input variables of the data set.
const std::string & get_unit(const size_t &) const
Matrix< std::string > arrange_inputs_information(void) const
void convert_autoassociation(void)
const Use & get_use(const size_t &) const
Vector< std::string > arrange_names(void) const
Returns the names of all the variables in the data set.
void set_use(const size_t &, const Use &)
Use use
Use of a variable (none, input or target).
Vector< size_t > count_uses(void) const
size_t count_targets_number(void) const
Returns the number of target variables of the data set.
void set_units(const Vector< std::string > &)
Vector< std::string > arrange_targets_name(void) const
Returns the names of the target variables in the data set.
Vector< std::string > write_uses(void) const
std::string to_string(void) const
Returns a string representation of the current variables object.
void set_names(const Vector< std::string > &)
const Vector< Item > & get_items(void) const
Returns the vector Item structures in the variables object.
bool is_used(const size_t &) const
Vector< Use > arrange_uses(void) const
std::string description
Description of a variable.
size_t get_variables_number(void) const
Returns the total number of variables in the data set.
size_t count_unused_variables_number(void) const
Returns the number of variables which will neither be used as input nor as target.
Variables & operator=(const Variables &)
bool operator==(const Variables &) const
Vector< std::string > arrange_descriptions(void) const
Returns the description of all the variables in the data set.
std::string write_use(const size_t &) const
std::string name
Name of a variable.
const Item & get_item(const size_t &) const
Vector< size_t > arrange_inputs_indices(void) const
Returns the indices of the input variables.
Vector< std::string > arrange_inputs_description(void) const
Returns the description of the input variables in the data set.