DataSet::Column Struct Reference

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
 

Detailed Description

This structure represents the columns of the DataSet.

Definition at line 110 of file data_set.h.

Constructor & Destructor Documentation

◆ Column() [1/2]

Column ( )

Default constructor.

Column default constructor.

Definition at line 102 of file data_set.cpp.

◆ Column() [2/2]

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>() 
)

Values constructor.

Column default constructor.

Definition at line 116 of file data_set.cpp.

◆ ~Column()

~Column ( )
virtual

Destructor.

Column destructor.

Definition at line 133 of file data_set.cpp.

Member Function Documentation

◆ add_category()

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

Parameters
new_categoryString that contains the name of the new category

Definition at line 270 of file data_set.cpp.

◆ from_XML()

void from_XML ( const tinyxml2::XMLDocument column_document)

Definition at line 342 of file data_set.cpp.

◆ get_categories_number()

Index get_categories_number ( ) const

Returns the number of categories.

Definition at line 735 of file data_set.cpp.

◆ get_used_categories_number()

Index get_used_categories_number ( ) const

Returns the number of used categories.

Definition at line 743 of file data_set.cpp.

◆ get_used_variables_names()

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.

◆ get_variables_number()

Index get_variables_number ( ) const

Definition at line 720 of file data_set.cpp.

◆ print()

void print ( ) const

Definition at line 611 of file data_set.cpp.

◆ set_categories_uses() [1/2]

void set_categories_uses ( const Tensor< string, 1 > &  new_categories_uses)

Sets the categories uses in the data set.

Parameters
new_categories_usesString vector that contains the new categories of the data set.

Definition at line 294 of file data_set.cpp.

◆ set_categories_uses() [2/2]

void set_categories_uses ( const VariableUse new_categories_use)

Sets the categories uses in the data set.

Parameters
new_categories_useNew categories use

Definition at line 336 of file data_set.cpp.

◆ set_scaler() [1/2]

void set_scaler ( const Scaler &  new_scaler)

Definition at line 137 of file data_set.cpp.

◆ set_scaler() [2/2]

void set_scaler ( const string &  new_scaler)

Definition at line 143 of file data_set.cpp.

◆ set_type()

void set_type ( const string &  new_column_type)

Sets the column type.

Parameters
new_column_typeColumn type in string format.

Definition at line 230 of file data_set.cpp.

◆ set_use() [1/2]

void set_use ( const string &  new_column_use)

Sets the use of the column and of the categories.

Parameters
new_column_useNew use of the column in string format.

Definition at line 196 of file data_set.cpp.

◆ set_use() [2/2]

void set_use ( const VariableUse new_column_use)

Sets the use of the column and of the categories.

Parameters
new_column_useNew use of the column.

Definition at line 182 of file data_set.cpp.

◆ write_XML()

void write_XML ( tinyxml2::XMLPrinter file_stream) const

Definition at line 470 of file data_set.cpp.

Member Data Documentation

◆ categories

Tensor<string, 1> categories

Categories within the column.

Definition at line 143 of file data_set.h.

◆ categories_uses

Tensor<VariableUse, 1> categories_uses

Categories use.

Definition at line 147 of file data_set.h.

◆ column_use

VariableUse column_use

Column use.

Definition at line 135 of file data_set.h.

◆ name

string name

Column name.

Definition at line 131 of file data_set.h.

◆ scaler

Scaler scaler

Definition at line 149 of file data_set.h.

◆ type

ColumnType type

Column type.

Definition at line 139 of file data_set.h.


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