genericROM.BasicAlgorithms.DataVisualization
- ApplyMDS(X, dimension, metric=True, dissimilarity='precomputed')[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
- PlotClusteringResultsAndSpecificPointsOnEmbeddedData(fileName, clusters, specificPoints, sizeSpecificPts=30, axesNames=None, colors=None)[source]
- PlotClusteringResultsOnEmbeddedData(fileName, clusters, representatives=None, plotLabels=False, axesNames=None, colors=None)[source]
- fit(X, dimension=2, outputName=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)[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]