![]() |
SG++-Doxygen-Documentation
|
#include <VisualizerClassification.hpp>
Public Member Functions | |
void | runVisualization (ModelFittingBase &model, DataSource &dataSource, size_t fold, size_t batch) override |
Method to run the visualization process for a given batch and fold. | |
VisualizerClassification ()=default | |
VisualizerClassification (VisualizerConfiguration config) | |
Constructor given a configuration. | |
~VisualizerClassification () override=default | |
![]() | |
void | runVisualization (ModelFittingBase &model, DataSource &dataSource, size_t fold, size_t batch) override |
Method to run the visualization process for a given batch and fold. | |
VisualizerDensityEstimation ()=default | |
VisualizerDensityEstimation (VisualizerConfiguration config) | |
Constructor given a configuration. | |
~VisualizerDensityEstimation () override=default | |
Default destructor. | |
![]() | |
const VisualizerConfiguration & | getVisualizerConfiguration () const |
Get the configuration of the visualizer object. | |
Visualizer () | |
virtual | ~Visualizer ()=default |
Virtual destructor. | |
Protected Member Functions | |
void | getHeatmap2DClassification (ModelFittingBase &model, std::string currentDirectory, DataMatrix &classMatrix) |
Method which generates the classification heatmap of models of 2 dimensions. | |
void | getHeatmap3DClassification (ModelFittingBase &model, std::string currentDirectory, DataMatrix &classMatrix) |
Method which generates the classification heatmap of models of 3 sdimensions. | |
void | getHeatmapMore4DClassification (ModelFittingBase &model, std::string currentDirectory, DataMatrix &classMatrix) |
Method which generates the classification heatmap of models of 4 or more dimensions. | |
void | getHeatmapsClassification (ModelFittingBase &model, std::string currentDirectory, DataMatrix &classMatrix) |
Method which starts the heatmap generation for Classification Models. | |
void | initializeMatrices (ModelFittingBase &model, DataMatrix &classMatrix) |
Method which builds the matrices used to generate the cuts and the heatmaps. | |
void | storeHeatmapJsonClassification (DataMatrix &matrix, ModelFittingBase &model, std::string filepath) |
Method to generate and store in json format for the plotly library the output of the classification heatmaps for models of 3 or more dimensions. | |
void | storeHeatmapJsonClassification (DataMatrix &matrix, ModelFittingBase &model, std::vector< size_t > indexes, size_t &varDim1, size_t &varDim2, std::string filepath) |
Method to generate and store in json format for the plotly library the output of the classification heatmaps for models of 2 dimensions. | |
void | storeTsneJson (DataMatrix &matrix, ModelFittingBase &model, std::string currentDirectory) |
Method to generate and store in json format for the plotly library the output of the tsne algorithm. | |
![]() | |
void | getHeatmap (ModelFittingBase &model, std::string currentDirectory, DataMatrix &matrix) |
Method which starts the heatmap generation for Density Estimation Models. | |
void | getHeatmap2D (ModelFittingBase &model, std::string currentDirectory, DataMatrix &matrix) |
Method which generates the heatmap of models of 2 dimensions. | |
void | getHeatmap3D (ModelFittingBase &model, std::string currentDirectory, DataMatrix &matrix) |
Method which generates the heatmap of models of 3 dimensions. | |
void | getHeatmapMore4D (ModelFittingBase &model, std::string currentDirectory, DataMatrix &matrix) |
Method which generates the heatmap of models of 4 or more dimensions. | |
void | getLinearCuts (ModelFittingBase &model, std::string currentDirectory, DataMatrix &matrix) |
Method which starts the linear cut generation for Density Estimation Models. | |
void | getLinearCuts1D (ModelFittingBase &model, std::string currentDirectory, DataMatrix &matrix) |
Method which generates the linear cuts graphs for models of 1 dimension. | |
void | getLinearCuts2D (ModelFittingBase &model, std::string currentDirectory, DataMatrix &matrix) |
Method which generates the linear cuts graphs for models of 2 dimensions. | |
void | getLinearCutsMore3D (ModelFittingBase &model, std::string currentDirectory, DataMatrix &matrix) |
Method which generates the linear cuts graphs for models of 3 or more dimensions. | |
void | initializeMatrices (ModelFittingBase &model, DataMatrix &cutMatrix, DataMatrix &heatMapMatrix) |
Method which builds the matrices used to generate the cuts and the heatmaps. | |
void | storeCutJson (DataMatrix &matrix, std::string filepath) |
Method to generate and store in json format for the plotly library the output of the linear cuts for models of 1 dimension. | |
void | storeCutJson (DataMatrix &matrix, std::vector< size_t > indexes, size_t &varDim, std::string filepath) |
Method to generate and store in json format for the plotly library the output of the linear cuts for models of 2 or more dimensions. | |
void | storeGrid (ModelFittingBase &model, std::string currentDirectory) |
Method which stores the coordinates of the grid points of a Density Estimation model. | |
void | storeHeatmapJson (DataMatrix &matrix, ModelFittingBase &model, std::string filepath) |
Method to generate and store in json format for the plotly library the output of the heatmaps for models of 2 dimensions. | |
void | storeHeatmapJson (DataMatrix &matrix, ModelFittingBase &model, std::vector< size_t > indexes, size_t &varDim1, size_t &varDim2, std::string filepath) |
Method to generate and store in json format for the plotly library the output of the hetamaps for models of 3 or more dimensions. | |
void | storeTsneJson (DataMatrix &matrix, ModelFittingBase &model, std::string currentDirectory) |
Method to generate and store in json format for the plotly library the output of the tsne algorithm. | |
void | swapColumns (DataMatrix &matrix, size_t col1, size_t col2) |
Method to swap to columns of a matrix. | |
void | translateColumns (DataMatrix &matrix, size_t maxColumns) |
Method which shifts one position the columns of a matrix from left to right in a circular fashion until the column given by the parameters maxColumns. | |
void | translateColumnsLeft (DataMatrix &matrix, std::vector< size_t > indexes) |
Method which shifts the columns given by the vector indexes of a matrix from right to left in a circular fashion. | |
void | translateColumnsRight (DataMatrix &matrix, std::vector< size_t > indexes) |
Method which shifts the columns given by the vector indexes of a matrix from left to right in a circular fashion. | |
void | updateIndexesCuts (std::vector< size_t > &columnIndexes, DataMatrix &matrix) |
Method to update the columns indexes to be shifted when generating the linear cuts. | |
void | updateIndexesHeatmap (std::vector< size_t > &columnIndexes, DataMatrix &matrix) |
Method to update the columns indexes to be shifted when generating the heatmap. | |
![]() | |
void | createFolder (std::string folder_path) |
Method to create a folder based on the operating system of the user. | |
Additional Inherited Members | |
![]() | |
VisualizerConfiguration | config |
Configuration object for the fitter. | |
std::string | currentDirectory |
Variable to store the current folder in which the visualizer is working on. | |
DataMatrix | originalData |
Matrix to store the data from the datasource. | |
size_t | resolution |
Resolution used in the graphs. | |
DataMatrix | tsneCompressedData |
Matrix to store the data provided by the tsne algorithm. | |
|
default |
|
explicit |
Constructor given a configuration.
config | The VisualizerConfiguration object which contains the configuration to run the visualization module |
References sgpp::datadriven::Visualizer::config.
|
overridedefault |
|
protected |
Method which generates the classification heatmap of models of 2 dimensions.
model | The model used to evaluate the heatmap |
currentDirectory | The current directory to store the heatmap results |
classMatrix | matrix to be evaluated to generate the heatmap |
References sgpp::base::DataMatrix::appendCol(), sgpp::datadriven::Visualizer::config, sgpp::datadriven::CSV, sgpp::datadriven::Visualizer::currentDirectory, sgpp::datadriven::ModelFittingBase::evaluate(), sgpp::datadriven::VisualizerConfiguration::getGeneralConfig(), sgpp::base::DataMatrix::getNrows(), sgpp::datadriven::json, storeHeatmapJsonClassification(), sgpp::datadriven::VisualizationGeneralConfig::targetFileType_, and sgpp::datadriven::CSVTools::writeMatrixToCSVFile().
Referenced by getHeatmapsClassification().
|
protected |
Method which generates the classification heatmap of models of 3 sdimensions.
model | The model used to evaluate the heatmap |
currentDirectory | The current directory to store the heatmap results |
classMatrix | matrix to be evaluated to generate the heatmap |
References sgpp::base::DataMatrix::appendCol(), sgpp::datadriven::Visualizer::config, sgpp::datadriven::CSV, sgpp::datadriven::Visualizer::currentDirectory, sgpp::datadriven::ModelFittingBase::evaluate(), sgpp::datadriven::VisualizerConfiguration::getGeneralConfig(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::datadriven::json, storeHeatmapJsonClassification(), sgpp::datadriven::VisualizationGeneralConfig::targetFileType_, sgpp::datadriven::VisualizerDensityEstimation::translateColumns(), and sgpp::datadriven::CSVTools::writeMatrixToCSVFile().
Referenced by getHeatmapsClassification().
|
protected |
Method which generates the classification heatmap of models of 4 or more dimensions.
model | The model used to evaluate the heatmap |
currentDirectory | The current directory to store the heatmap results |
classMatrix | matrix to be evaluated to generate the heatmap |
References sgpp::base::DataMatrix::appendCol(), sgpp::datadriven::Visualizer::config, sgpp::datadriven::Visualizer::createFolder(), sgpp::datadriven::CSV, sgpp::datadriven::Visualizer::currentDirectory, sgpp::datadriven::ModelFittingBase::evaluate(), sgpp::datadriven::VisualizerConfiguration::getGeneralConfig(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::datadriven::json, storeHeatmapJsonClassification(), sgpp::datadriven::VisualizationGeneralConfig::targetFileType_, sgpp::datadriven::VisualizerDensityEstimation::translateColumnsLeft(), sgpp::datadriven::VisualizerDensityEstimation::translateColumnsRight(), sgpp::datadriven::VisualizerDensityEstimation::updateIndexesHeatmap(), and sgpp::datadriven::CSVTools::writeMatrixToCSVFile().
Referenced by getHeatmapsClassification().
|
protected |
Method which starts the heatmap generation for Classification Models.
model | The model used to evaluate the heatmap |
currentDirectory | The current directory to store the heatmap results |
classMatrix | matrix to be evaluated to generate the heatmap |
References sgpp::datadriven::Visualizer::createFolder(), sgpp::datadriven::Visualizer::currentDirectory, sgpp::datadriven::ModelFittingBase::getDataset(), sgpp::datadriven::Dataset::getDimension(), getHeatmap2DClassification(), getHeatmap3DClassification(), and getHeatmapMore4DClassification().
Referenced by runVisualization().
|
protected |
Method which builds the matrices used to generate the cuts and the heatmaps.
model | The model used to evaluate the linear cuts and the heatmaps |
classMatrix | matrix to be initialized |
References sgpp::base::DataMatrix::appendRow(), sgpp::datadriven::ModelFittingBase::getDataset(), sgpp::datadriven::Dataset::getDimension(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::resize(), sgpp::datadriven::Visualizer::resolution, and sgpp::base::DataVector::set().
Referenced by runVisualization().
|
overridevirtual |
Method to run the visualization process for a given batch and fold.
model | The model used to evaluate the visualization |
dataSource | The datasource from where the data points are obtained |
fold | The current fold being processed |
batch | The current batch being processed |
Implements sgpp::datadriven::Visualizer.
References sgpp::datadriven::VisualizationGeneralConfig::algorithm_, sgpp::datadriven::Visualizer::config, sgpp::datadriven::Visualizer::createFolder(), sgpp::datadriven::VisualizationGeneralConfig::crossValidation_, sgpp::datadriven::Visualizer::currentDirectory, sgpp::datadriven::VisualizationGeneralConfig::execute_, sgpp::base::DataVector::get(), sgpp::datadriven::DataSource::getAllSamples(), sgpp::datadriven::ModelFittingClassification::getClassIdx(), sgpp::datadriven::Dataset::getData(), sgpp::datadriven::ModelFittingBase::getFitterConfiguration(), sgpp::datadriven::VisualizerConfiguration::getGeneralConfig(), sgpp::datadriven::FitterConfiguration::getGridConfig(), sgpp::datadriven::VisualizerDensityEstimation::getHeatmap(), getHeatmapsClassification(), sgpp::datadriven::VisualizerDensityEstimation::getLinearCuts(), sgpp::datadriven::ModelFittingClassification::getModels(), sgpp::datadriven::VisualizerConfiguration::getVisualizationParameters(), initializeMatrices(), sgpp::datadriven::VisualizerDensityEstimation::initializeMatrices(), sgpp::base::GeneralGridConfiguration::level_, sgpp::datadriven::VisualizationGeneralConfig::numBatches_, sgpp::datadriven::VisualizationParameters::numberCores_, sgpp::datadriven::Visualizer::originalData, sgpp::base::DataVector::resizeZero(), sgpp::datadriven::Visualizer::resolution, sgpp::base::DataVector::set(), and sgpp::datadriven::VisualizationGeneralConfig::targetDirectory_.
|
protected |
Method to generate and store in json format for the plotly library the output of the classification heatmaps for models of 3 or more dimensions.
matrix | Matrix with the content to be stored |
model | The model used when evaluating the heatmaps |
filepath | The current directory to store the json file |
References json::DictNode::addDictAttr(), json::Node::addDictValue(), json::DictNode::addIDAttr(), json::DictNode::addListAttr(), sgpp::base::DataMatrix::appendCol(), sgpp::base::DataMatrix::appendRow(), json::Node::clone(), sgpp::base::DataMatrix::copyFrom(), sgpp::datadriven::ModelFittingClassification::evaluate(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::getColumn(), sgpp::datadriven::ModelFittingClassification::getModels(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getRow(), sgpp::base::DataVector::getSize(), grid(), sgpp::base::DataMatrix::max(), sgpp::base::DataMatrix::min(), sgpp::datadriven::Visualizer::originalData, json::JSON::serialize(), and sgpp::base::DataVector::toString().
Referenced by getHeatmap2DClassification(), getHeatmap3DClassification(), and getHeatmapMore4DClassification().
|
protected |
Method to generate and store in json format for the plotly library the output of the classification heatmaps for models of 2 dimensions.
matrix | Matrix with the content to be stored |
model | The model used when evaluating the heatmaps |
indexes | Vectors containing the dimensions used when generating these heatmaps |
varDim1 | The first dimension number varying and whose evaluation is shown in the model |
varDim2 | The second dimension number varying and whose evaluation is shown in the model |
filepath | The current directory to store the json file |
References json::DictNode::addDictAttr(), json::Node::addDictValue(), json::DictNode::addIDAttr(), json::Node::addIdValue(), json::DictNode::addListAttr(), sgpp::base::DataMatrix::appendCol(), sgpp::base::DataMatrix::appendRow(), sgpp::base::DataMatrix::copyFrom(), sgpp::datadriven::ModelFittingClassification::evaluate(), sgpp::base::DataVector::get(), sgpp::base::DataMatrix::getColumn(), sgpp::datadriven::ModelFittingClassification::getModels(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getRow(), sgpp::base::DataVector::getSize(), grid(), sgpp::base::DataMatrix::max(), sgpp::base::DataMatrix::min(), sgpp::datadriven::Visualizer::originalData, sgpp::base::DataMatrix::resizeToSubMatrix(), json::JSON::serialize(), and sgpp::base::DataVector::toString().
|
protected |
Method to generate and store in json format for the plotly library the output of the tsne algorithm.
matrix | Matrix with the content to be stored |
model | Model used in the evaluation |
currentDirectory | The current directory to store the json file |
References json::DictNode::addDictAttr(), json::Node::addDictValue(), json::DictNode::addIDAttr(), json::DictNode::addListAttr(), sgpp::datadriven::Visualizer::currentDirectory, sgpp::base::DataMatrix::getColumn(), sgpp::base::DataMatrix::getNrows(), json::JSON::serialize(), and sgpp::base::DataVector::toString().