![]() |
UFJF - Machine Learning Toolkit
0.51.8
|
Class for data visualization. More...
#include <Visualization.hpp>
Public Member Functions | |
Visualization (bool shared_session=true, bool keep_temp_files=false) | |
Visualization (Data< T > &sample, bool shared_session=true, bool keep_temp_files=false) | |
void | setTerminal (const std::string &terminal) |
void | setSample (Data< T > &sample) |
Set sample to be visualized. More... | |
void | setTitle (std::string title) |
Set plot title. More... | |
void | setStyle (std::string style) |
Set plot style. (points, lines, etc.) More... | |
std::string | execute_command (const std::string &cmd, bool fetch_configs=true) |
std::string | plot1DRegresion (int x=0, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y") |
Plot the data as a regression dataset with points values in the y-axis. More... | |
std::string | plot1DRegresionHyperplane (int x, Solution s, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y") |
Plot the data as a regression dataset with points values in the y-axis alongside with a regressor solution. More... | |
std::string | plot2D (int x=0, int y=1, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y") |
Plot the selected features in 2D. More... | |
std::string | plot2D (mltk::Point< double > x, mltk::Point< double > y, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y") |
std::string | plot2DwithHyperplane (int x, int y, Solution w, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y") |
Plot the data in 2D with the hyperplane in solution generated by a classifier. More... | |
std::string | plot2DRegresion (int x=0, int y=1, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y", const std::string &z_label="z") |
Plot the data as a regression dataset with points values in the z-axis. More... | |
std::string | plot2DRegresionHyperplane (int x, int y, Solution s, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y", const std::string &z_label="z") |
Plot the data as a regression dataset with points values in the z-axis alongside with a regressor solution. More... | |
std::string | plot3D (int x=0, int y=1, int z=2, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y", const std::string &z_label="z") |
Plot the selected features in 3D. More... | |
std::string | plot3D (mltk::Point< double > x, mltk::Point< double > y, mltk::Point< double > z, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y", const std::string &z_label="z") |
std::string | plot3DwithHyperplane (int x, int y, int z, Solution w, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y", const std::string &z_label="z") |
Plot the data in 2D with separated by the hyperplane in the solution. More... | |
template<class Learner > | |
std::string | plotDecisionSurface2D (Learner &learner, int x=0, int y=1, bool is_trained=true, size_t grid_dim=50, bool save=false, double scale=1.0, const std::string &title="", const std::string &format="svg", const std::string &x_label="x", const std::string &y_label="y") |
Plot the decision boundary of a classifier with the data points above it. More... | |
Static Public Member Functions | |
static void | cmd (const std::string &command) |
Execute a script on gnuplot. More... | |
Class for data visualization.
|
static |
Execute a script on gnuplot.
command | script to be executed. |
std::string mltk::visualize::Visualization< T >::plot1DRegresion | ( | int | x = 0 , |
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" |
||
) |
Plot the data as a regression dataset with points values in the y-axis.
x | Feature to be used in the x-axis. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
std::string mltk::visualize::Visualization< T >::plot1DRegresionHyperplane | ( | int | x, |
Solution | s, | ||
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" |
||
) |
Plot the data as a regression dataset with points values in the y-axis alongside with a regressor solution.
x | Feature to be used in the x-axis. |
s | Learner solution with the hyperplane to be plotted. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
std::string mltk::visualize::Visualization< T >::plot2D | ( | int | x = 0 , |
int | y = 1 , |
||
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" |
||
) |
Plot the selected features in 2D.
x | Feature to be used in the x-axis. |
y | Feature to be used in the y-axis. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
std::string mltk::visualize::Visualization< T >::plot2DRegresion | ( | int | x = 0 , |
int | y = 1 , |
||
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" , |
||
const std::string & | z_label = "z" |
||
) |
Plot the data as a regression dataset with points values in the z-axis.
x | Feature to be used in the x-axis. |
y | Feature to be used in the y-axis. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
z_label | z-axis label. |
std::string mltk::visualize::Visualization< T >::plot2DRegresionHyperplane | ( | int | x, |
int | y, | ||
Solution | s, | ||
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" , |
||
const std::string & | z_label = "z" |
||
) |
Plot the data as a regression dataset with points values in the z-axis alongside with a regressor solution.
x | Feature to be used in the x-axis. |
y | Feature to be used in the y-axis. |
s | Learner solution with the hyperplane to be plotted. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
z_label | z-axis label. |
std::string mltk::visualize::Visualization< T >::plot2DwithHyperplane | ( | int | x, |
int | y, | ||
Solution | w, | ||
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" |
||
) |
Plot the data in 2D with the hyperplane in solution generated by a classifier.
x | Feature to be used in the x-axis. |
y | Feature to be used in the y-axis. |
w | Learner solution with the hyperplane to be plotted. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
std::string mltk::visualize::Visualization< T >::plot3D | ( | int | x = 0 , |
int | y = 1 , |
||
int | z = 2 , |
||
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" , |
||
const std::string & | z_label = "z" |
||
) |
Plot the selected features in 3D.
x | Feature to be used in the x-axis. |
y | Feature to be used in the y-axis. |
z | Feature to be used in the z-axis. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
z_label | z-axis label. |
std::string mltk::visualize::Visualization< T >::plot3DwithHyperplane | ( | int | x, |
int | y, | ||
int | z, | ||
Solution | w, | ||
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" , |
||
const std::string & | z_label = "z" |
||
) |
Plot the data in 2D with separated by the hyperplane in the solution.
x | Feature to be used in the x-axis. |
y | Feature to be used in the y-axis. |
z | Feature to be used in the z-axis. |
w | Learner solution with the hyperplane to be plotted. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
z_label | z-axis label. |
std::string mltk::visualize::Visualization< T >::plotDecisionSurface2D | ( | Learner & | learner, |
int | x = 0 , |
||
int | y = 1 , |
||
bool | is_trained = true , |
||
size_t | grid_dim = 50 , |
||
bool | save = false , |
||
double | scale = 1.0 , |
||
const std::string & | title = "" , |
||
const std::string & | format = "svg" , |
||
const std::string & | x_label = "x" , |
||
const std::string & | y_label = "y" |
||
) |
Plot the decision boundary of a classifier with the data points above it.
Learner | Classifier wrapper type. |
learner | Classifier for decision boundary generation. |
x | Feature to be used in the x-axis. |
y | Feature to be used in the y-axis. |
is_trained | If the classifier is not trained, the method will call the train method. |
grid_dim | Dimensions for the decision boundary grid. The plot has better resolution with bigger values, but it takes more time to generate the plot. |
save | If true, save the plot to disk, otherwise it shows the plot on the screen. |
scale | Scale factor for all axis of the plot. |
title | Plot title. |
format | Plot output format if is set to save to disk. |
x_label | x-axis label. |
y_label | y-axis label. |
void mltk::visualize::Visualization< T >::setSample | ( | Data< T > & | sample | ) |
Set sample to be visualized.
sample | samples for visualization. |
void mltk::visualize::Visualization< T >::setStyle | ( | std::string | style | ) |
Set plot style. (points, lines, etc.)
style | Style to be set. |
void mltk::visualize::Visualization< T >::setTitle | ( | std::string | title | ) |
Set plot title.
title | Plot title. |