This structure represents the columns of the DataSet. More...
#include <data_set.h>
Public Member Functions | |
Column () | |
Default constructor. More... | |
Column (const string &, const VariableUse &, const ColumnType &=ColumnType::Numeric, const Scaler &=Scaler::MeanStandardDeviation, const Tensor< string, 1 > &=Tensor< string, 1 >(), const Tensor< VariableUse, 1 > &=Tensor< VariableUse, 1 >()) | |
Values constructor. More... | |
virtual | ~Column () |
Destructor. More... | |
Index | get_variables_number () const |
Index | get_categories_number () const |
Returns the number of categories. More... | |
Index | get_used_categories_number () const |
Returns the number of used categories. More... | |
Tensor< string, 1 > | get_used_variables_names () const |
Returns a string vector that contains the names of the used variables in the data set. More... | |
void | set_scaler (const Scaler &) |
void | set_scaler (const string &) |
void | set_use (const VariableUse &) |
void | set_use (const string &) |
void | set_type (const string &) |
void | add_category (const string &) |
void | set_categories_uses (const Tensor< string, 1 > &) |
void | set_categories_uses (const VariableUse &) |
bool | is_used () |
bool | is_unused () |
void | from_XML (const tinyxml2::XMLDocument &) |
void | write_XML (tinyxml2::XMLPrinter &) const |
void | print () const |
Public Attributes | |
string | name |
Column name. More... | |
VariableUse | column_use |
Column use. More... | |
ColumnType | type |
Column type. More... | |
Tensor< string, 1 > | categories |
Categories within the column. More... | |
Tensor< VariableUse, 1 > | categories_uses |
Categories use. More... | |
Scaler | scaler |
This structure represents the columns of the DataSet.
Definition at line 110 of file data_set.h.
Column | ( | ) |
Column | ( | const string & | new_name, |
const VariableUse & | new_column_use, | ||
const ColumnType & | new_type = ColumnType::Numeric , |
||
const Scaler & | new_scaler = Scaler::MeanStandardDeviation , |
||
const Tensor< string, 1 > & | new_categories = Tensor<string, 1>() , |
||
const Tensor< VariableUse, 1 > & | new_categories_uses = Tensor<VariableUse, 1>() |
||
) |
|
virtual |
void add_category | ( | const string & | new_category | ) |
Adds a category to the categories vector of this column. It also adds a default use for the category
new_category | String that contains the name of the new category |
Definition at line 270 of file data_set.cpp.
void from_XML | ( | const tinyxml2::XMLDocument & | column_document | ) |
Definition at line 342 of file data_set.cpp.
Index get_categories_number | ( | ) | const |
Returns the number of categories.
Definition at line 735 of file data_set.cpp.
Index get_used_categories_number | ( | ) | const |
Returns the number of used categories.
Definition at line 743 of file data_set.cpp.
Tensor< string, 1 > get_used_variables_names | ( | ) | const |
Returns a string vector that contains the names of the used variables in the data set.
Definition at line 758 of file data_set.cpp.
Index get_variables_number | ( | ) | const |
Definition at line 720 of file data_set.cpp.
void print | ( | ) | const |
Definition at line 611 of file data_set.cpp.
void set_categories_uses | ( | const Tensor< string, 1 > & | new_categories_uses | ) |
Sets the categories uses in the data set.
new_categories_uses | String vector that contains the new categories of the data set. |
Definition at line 294 of file data_set.cpp.
void set_categories_uses | ( | const VariableUse & | new_categories_use | ) |
Sets the categories uses in the data set.
new_categories_use | New categories use |
Definition at line 336 of file data_set.cpp.
void set_scaler | ( | const Scaler & | new_scaler | ) |
Definition at line 137 of file data_set.cpp.
void set_scaler | ( | const string & | new_scaler | ) |
Definition at line 143 of file data_set.cpp.
void set_type | ( | const string & | new_column_type | ) |
Sets the column type.
new_column_type | Column type in string format. |
Definition at line 230 of file data_set.cpp.
void set_use | ( | const string & | new_column_use | ) |
Sets the use of the column and of the categories.
new_column_use | New use of the column in string format. |
Definition at line 196 of file data_set.cpp.
void set_use | ( | const VariableUse & | new_column_use | ) |
Sets the use of the column and of the categories.
new_column_use | New use of the column. |
Definition at line 182 of file data_set.cpp.
void write_XML | ( | tinyxml2::XMLPrinter & | file_stream | ) | const |
Definition at line 470 of file data_set.cpp.
Tensor<string, 1> categories |
Categories within the column.
Definition at line 143 of file data_set.h.
Tensor<VariableUse, 1> categories_uses |
Categories use.
Definition at line 147 of file data_set.h.
VariableUse column_use |
Column use.
Definition at line 135 of file data_set.h.
string name |
Column name.
Definition at line 131 of file data_set.h.
Scaler scaler |
Definition at line 149 of file data_set.h.
ColumnType type |
Column type.
Definition at line 139 of file data_set.h.