OpenNN
2.2
Open Neural Networks Library
|
#include <missing_values.h>
Classes | |
struct | Item |
Public Types | |
enum | ScrubbingMethod { Unuse, Mean, NoScrubbing } |
Public Member Functions | |
MissingValues (void) | |
MissingValues (const size_t &, const size_t &) | |
MissingValues (const tinyxml2::XMLDocument &) | |
MissingValues (const MissingValues &) | |
virtual | ~MissingValues (void) |
MissingValues & | operator= (const MissingValues &) |
bool | operator== (const MissingValues &) const |
size_t | get_instances_number (void) const |
size_t | get_variables_number (void) const |
size_t | get_missing_values_number (void) const |
Vector< size_t > | get_missing_values_numbers (void) const |
const Vector< Item > & | get_items (void) const |
const Item & | get_item (const size_t &) const |
ScrubbingMethod | get_scrubbing_method (void) const |
std::string | write_scrubbing_method (void) const |
std::string | write_scrubbing_method_text (void) const |
const bool & | get_display (void) const |
void | set (void) |
void | set (const size_t &, const size_t &) |
void | set (const tinyxml2::XMLDocument &) |
void | set_instances_number (const size_t &) |
void | set_variables_number (const size_t &) |
void | set_default (void) |
void | set_missing_values_number (const size_t &) |
void | set_scrubbing_method (const ScrubbingMethod &) |
void | set_scrubbing_method (const std::string &) |
void | set_display (const bool &) |
void | set_items (const Vector< Item > &) |
void | set_item (const size_t &, const size_t &, const size_t &) |
void | append (const size_t &, const size_t &) |
bool | has_missing_values (void) const |
bool | has_missing_values (const size_t &) const |
bool | has_missing_values (const size_t &, const Vector< size_t > &) const |
bool | is_missing_value (const size_t &, const size_t &) const |
Vector< size_t > | arrange_missing_instances (void) const |
size_t | count_missing_instances (void) const |
Vector< size_t > | arrange_missing_variables (void) const |
Vector< Vector< size_t > > | arrange_missing_indices (void) const |
void | convert_time_series (const size_t &) |
void | convert_autoassociation (void) |
std::string | to_string (void) const |
void | print (void) const |
tinyxml2::XMLDocument * | to_XML (void) const |
void | from_XML (const tinyxml2::XMLDocument &) |
Private Attributes | |
size_t | instances_number |
size_t | variables_number |
ScrubbingMethod | scrubbing_method |
Vector< Item > | items |
bool | display |
This class is used to store information about the missing values of a data set.
Definition at line 47 of file missing_values.h.
|
explicit |
Default constructor. It creates a missing values object with zero missing values. It also initializes the rest of class members to their default values.
Definition at line 27 of file missing_values.cpp.
|
explicit |
Missing values number constructor. It creates a data set object with a given number of missing values. It also initializes the rest of class members to their default values.
Definition at line 41 of file missing_values.cpp.
|
explicit |
XML constructor. It creates a missing balues object by loading the object members from a TinyXML document.
missing_values_document | XML document from the TinyXML library. |
Definition at line 55 of file missing_values.cpp.
OpenNN::MissingValues::MissingValues | ( | const MissingValues & | other_missing_values | ) |
Copy constructor. It creates a copy of an existing MissingValues object.
other_missing_values | Missing balues object to be copied. |
Definition at line 67 of file missing_values.cpp.
void OpenNN::MissingValues::append | ( | const size_t & | instance_index, |
const size_t & | variable_index | ||
) |
Appends a new item to the vector of missing values.
instance_index | Instance with a missing value. |
variable_index | Variable with a missing value. |
Definition at line 469 of file missing_values.cpp.
Returns a vector of vectors with the indices of the missing values for each variable. The size of the vector is the number of variables. The size of each subvector is the number of missing values for the corresponding variable.
Definition at line 770 of file missing_values.cpp.
void OpenNN::MissingValues::convert_autoassociation | ( | void | ) |
Definition at line 755 of file missing_values.cpp.
void OpenNN::MissingValues::convert_time_series | ( | const size_t & | lags_number | ) |
Definition at line 713 of file missing_values.cpp.
void OpenNN::MissingValues::from_XML | ( | const tinyxml2::XMLDocument & | document | ) |
Deserializes a TinyXML document into this MissingValues object.
document | XML document containing the member data. |
Definition at line 910 of file missing_values.cpp.
const bool & OpenNN::MissingValues::get_display | ( | void | ) | 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 297 of file missing_values.cpp.
const MissingValues::Item & OpenNN::MissingValues::get_item | ( | const size_t & | index | ) | const |
Returns a single missing value, with information about the instance and variable indices.
index | Index of missing value. |
Definition at line 195 of file missing_values.cpp.
Vector< size_t > OpenNN::MissingValues::get_missing_values_numbers | ( | void | ) | const |
Returns a vector with the number of missing values for each variable in the data set. The size of the vector is the number of variables.
Definition at line 161 of file missing_values.cpp.
bool OpenNN::MissingValues::has_missing_values | ( | void | ) | const |
Returns true if there are missing values, and false if the number of missing values is zero.
Definition at line 557 of file missing_values.cpp.
bool OpenNN::MissingValues::has_missing_values | ( | const size_t & | instance_index | ) | const |
Returns true if a given instance has missing values, and false otherwise.
instance_index | Index of instance. |
Definition at line 576 of file missing_values.cpp.
bool OpenNN::MissingValues::has_missing_values | ( | const size_t & | instance_index, |
const Vector< size_t > & | variables_indices | ||
) | const |
Returns true if a given instance has missing values for given variables, and false otherwise.
instance_index | Index of instance. |
variables_indices | Indices of variables. |
Definition at line 604 of file missing_values.cpp.
bool OpenNN::MissingValues::is_missing_value | ( | const size_t & | instance_index, |
const size_t & | variable_index | ||
) | const |
Returns true if the value with given instance and variable indices is missing.
instance_index | Index of instance. |
variable_index | Index of variable. |
Definition at line 634 of file missing_values.cpp.
MissingValues & OpenNN::MissingValues::operator= | ( | const MissingValues & | other_missing_values | ) |
Assignment operator. It assigns to the current object the members of an existing missing values object.
other_missing_values | Missing values object to be assigned. |
Definition at line 95 of file missing_values.cpp.
bool OpenNN::MissingValues::operator== | ( | const MissingValues & | other_missing_values | ) | const |
Equal to operator. It compares this object with another object of the same class. It returns true if the members of the two objects have the same values, and false otherwise. @ param other_missing_values Missing values object to be compared with.
Definition at line 120 of file missing_values.cpp.
void OpenNN::MissingValues::set | ( | const size_t & | new_instances_number, |
const size_t & | new_variables_number | ||
) |
Sets a new number of missing values in the object.
new_instances_number | Number of instances in the data set. |
new_variables_number | Number of variables in the data set. |
Definition at line 324 of file missing_values.cpp.
void OpenNN::MissingValues::set | ( | const tinyxml2::XMLDocument & | document | ) |
Sets the members of this object from a XML document.
document | Pointer to a TinyXML document containing the member data. |
Definition at line 340 of file missing_values.cpp.
void OpenNN::MissingValues::set_default | ( | void | ) |
Sets the default values to this MissingValues object:
Definition at line 380 of file missing_values.cpp.
void OpenNN::MissingValues::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.
new_display | Display value. |
Definition at line 395 of file missing_values.cpp.
void OpenNN::MissingValues::set_missing_values_number | ( | const size_t & | new_missing_values_number | ) |
Sets a new number of missing values in the data set.
new_missing_values_number | Number of missing values. |
Definition at line 508 of file missing_values.cpp.
void OpenNN::MissingValues::set_scrubbing_method | ( | const ScrubbingMethod & | new_scrubbing_method | ) |
Sets a new method for dealing with the missing values.
new_scrubbing_method | Scrubbing method. |
Definition at line 519 of file missing_values.cpp.
void OpenNN::MissingValues::set_scrubbing_method | ( | const std::string & | new_scrubbing_method | ) |
Sets a new method for dealing with the missing values from a string.
new_scrubbing_method | String with the name of the scrubbing method. |
Definition at line 530 of file missing_values.cpp.
tinyxml2::XMLDocument * OpenNN::MissingValues::to_XML | ( | void | ) | const |
Serializes the MissingValues 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 797 of file missing_values.cpp.