genericROM.BasicAlgorithms.DataVisualization module

ApplyMDS(X, dimension, metric=True, dissimilarity='precomputed', random_state=None)[source]

Wrapper of scikit-learn’s multidimensional scaling (MDS) function.

Plot2DClusteringResults(fileName, dataset, clusters, representatives=None, plotLabels=False, axesNames=None, colors=None)[source]
Plot2DClusteringResultsWithSpecificPoints(fileName, dataset, clusters, specificPoints, sizeSpecificPts=30, axesNames=None, colors=None)[source]
Plot3DClusteringResults(fileName, dataset, clusters, representatives=None, plotLabels=False, axesNames=None, colors=None)[source]
Plot3DClusteringResultsWithSpecificPoints(fileName, dataset, clusters, specificPoints, sizeSpecificPts=30, axesNames=None, colors=None)[source]
class VisualizationToolbox(method=None, dissimilarity=None)[source]

Bases: object

method

String indicating the visualization method.

Type:

str, ‘t-SNE’ or ‘MDS’

dissimilarity

Use ‘precomputed’ if your input is a dissimilarity matrix. Use ‘euclidean’ if your input is an array containing data points.

Type:

str, ‘precomputed’ or ‘euclidean’

tSNEperplexity

Parameter of the t-SNE algorithm, see Scikit-Learn’s documentation.

Type:

float

embeddedData

Array containing the embedded representation of some data, with embedded data points given in rows.

Type:

2D array

GetEmbeddedData()[source]
LoadEmbeddedData(dataFile)[source]
PlotClusteringResultsAndSpecificPointsOnEmbeddedData(fileName, clusters, specificPoints, sizeSpecificPts=30, axesNames=None, colors=None)[source]
PlotClusteringResultsOnEmbeddedData(fileName, clusters, representatives=None, plotLabels=False, axesNames=None, colors=None)[source]
PlotEmbeddedData(fileName, axesNames)[source]
SetEmbeddedData(X)[source]
SetTSNEPerplexity(tSNEperplexity)[source]
fit(X, dimension=2, outputName=None, random_state=None)[source]

Computes the embedded representation of X.

Parameters:
  • X (2D array of shape [n_samples, n_features] or [n_samples, n_samples]) – Contains either examples in rows or a precomputed dissimilarity matrix. Be sure you set self.method = ‘euclidean’ if X contains examples in rows, or self.method = ‘precomputed’ if X is a precomputed dissimilarity matrix.

  • dimension (int) – Dimension of the embedding space.

  • outputName (str) – Name of the npy output file where the embedded dataset is saved.

fit_transform(X, dimension=2, outputName=None, random_state=None)[source]

Computes and returns the embedded representation of X.

Parameters:
  • X (2D array of shape [n_samples, n_features] or [n_samples, n_samples]) – Contains either examples in rows or a precomputed dissimilarity matrix. Be sure you set self.method = ‘euclidean’ if X contains examples in rows, or self.method = ‘precomputed’ if X is a precomputed dissimilarity matrix.

  • dimension (int) – Dimension of the embedding space.

  • outputName (str) – Name of the npy output file where the embedded dataset is saved.

Returns:

embeddedData

Return type:

2D array of shape [n_samples, dimension]