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

#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)
 
MissingValuesoperator= (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 Itemget_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_association (void)
 
std::string to_string (void) const
 
void print (void) const
 
tinyxml2::XMLDocument * to_XML (void) const
 
void from_XML (const tinyxml2::XMLDocument &)
 
void write_XML (tinyxml2::XMLPrinter &) const
 

Private Attributes

size_t instances_number
 
size_t variables_number
 
ScrubbingMethod scrubbing_method
 
Vector< Itemitems
 
bool display
 

Detailed Description

Missing values are those elements which are not present in the data set." Therefore, they represent a lack of information about several variables in several instances.; This class is used to store information about the missing values of a data set.

Definition at line 47 of file missing_values.h.

Constructor & Destructor Documentation

◆ MissingValues() [1/4]

OpenNN::MissingValues::MissingValues ( void  )
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.

◆ MissingValues() [2/4]

OpenNN::MissingValues::MissingValues ( const size_t &  new_instances_number,
const size_t &  new_variables_number 
)
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.

◆ MissingValues() [3/4]

OpenNN::MissingValues::MissingValues ( const tinyxml2::XMLDocument &  missing_values_document)
explicit

XML constructor. It creates a missing balues object by loading the object members from a TinyXML document.

Parameters
missing_values_documentXML document from the TinyXML library.

Definition at line 55 of file missing_values.cpp.

◆ MissingValues() [4/4]

OpenNN::MissingValues::MissingValues ( const MissingValues other_missing_values)

Copy constructor. It creates a copy of an existing MissingValues object.

Parameters
other_missing_valuesMissing balues object to be copied.

Definition at line 67 of file missing_values.cpp.

Member Function Documentation

◆ append()

void OpenNN::MissingValues::append ( const size_t &  instance_index,
const size_t &  variable_index 
)

Appends a new item to the vector of missing values.

Parameters
instance_indexInstance with a missing value.
variable_indexVariable with a missing value.

Definition at line 469 of file missing_values.cpp.

◆ arrange_missing_indices()

Vector< Vector< size_t > > OpenNN::MissingValues::arrange_missing_indices ( void  ) const

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.

◆ convert_association()

void OpenNN::MissingValues::convert_association ( void  )
Todo:
Implement this method.

Definition at line 755 of file missing_values.cpp.

◆ convert_time_series()

void OpenNN::MissingValues::convert_time_series ( const size_t &  lags_number)
Todo:
Complete method.

Definition at line 713 of file missing_values.cpp.

◆ from_XML()

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

Deserializes a TinyXML document into this MissingValues object.

Parameters
documentXML document containing the member data.
Todo:
Check that the method i

Definition at line 1073 of file missing_values.cpp.

◆ get_display()

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.

◆ get_item()

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.

Parameters
indexIndex of missing value.

Definition at line 195 of file missing_values.cpp.

◆ get_missing_values_numbers()

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.

◆ has_missing_values() [1/3]

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.

◆ has_missing_values() [2/3]

bool OpenNN::MissingValues::has_missing_values ( const size_t &  instance_index) const

Returns true if a given instance has missing values, and false otherwise.

Parameters
instance_indexIndex of instance.

Definition at line 576 of file missing_values.cpp.

◆ has_missing_values() [3/3]

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.

Parameters
instance_indexIndex of instance.
variables_indicesIndices of variables.

Definition at line 604 of file missing_values.cpp.

◆ is_missing_value()

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.

Parameters
instance_indexIndex of instance.
variable_indexIndex of variable.

Definition at line 634 of file missing_values.cpp.

◆ operator=()

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.

Parameters
other_missing_valuesMissing values object to be assigned.

Definition at line 95 of file missing_values.cpp.

◆ operator==()

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.

◆ set() [1/2]

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.

Parameters
new_instances_numberNumber of instances in the data set.
new_variables_numberNumber of variables in the data set.

Definition at line 324 of file missing_values.cpp.

◆ set() [2/2]

void OpenNN::MissingValues::set ( const tinyxml2::XMLDocument &  document)

Sets the members of this object from a XML document.

Parameters
documentPointer to a TinyXML document containing the member data.

Definition at line 340 of file missing_values.cpp.

◆ set_default()

void OpenNN::MissingValues::set_default ( void  )

Sets the default values to this MissingValues object:

  • scrubbing_method: Unuse
  • display: true

Definition at line 380 of file missing_values.cpp.

◆ set_display()

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.

Parameters
new_displayDisplay value.

Definition at line 395 of file missing_values.cpp.

◆ set_missing_values_number()

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.

Parameters
new_missing_values_numberNumber of missing values.

Definition at line 508 of file missing_values.cpp.

◆ set_scrubbing_method() [1/2]

void OpenNN::MissingValues::set_scrubbing_method ( const ScrubbingMethod new_scrubbing_method)

Sets a new method for dealing with the missing values.

Parameters
new_scrubbing_methodScrubbing method.

Definition at line 519 of file missing_values.cpp.

◆ set_scrubbing_method() [2/2]

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.

Parameters
new_scrubbing_methodString with the name of the scrubbing method.

Definition at line 530 of file missing_values.cpp.

◆ to_XML()

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.

Todo:

Definition at line 797 of file missing_values.cpp.

◆ write_XML()

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

Serializes the missing values 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 960 of file missing_values.cpp.


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