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_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< Itemitems
 
bool display
 

Detailed Description

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

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.

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.

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.

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

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.

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.

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

Definition at line 755 of file missing_values.cpp.

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

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.

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

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.

Parameters
indexIndex 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.

Parameters
instance_indexIndex 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.

Parameters
instance_indexIndex of instance.
variables_indicesIndices 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.

Parameters
instance_indexIndex of instance.
variable_indexIndex 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.

Parameters
other_missing_valuesMissing 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.

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.

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.

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.

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.

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.

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.

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.

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.


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