public class TSNE extends Object implements VisualizationTransform
PCA
or some similar
technique.Constructor and Description |
---|
TSNE() |
Modifier and Type | Method and Description |
---|---|
protected static void |
computeP(DataSet d,
ExecutorService ex,
Random rand,
int knn,
int[][] nearMe,
double[][] nearMePij,
DistanceMetric dm,
double perplexity) |
double |
getAlpha() |
int |
getIterations() |
double |
getPerplexity() |
int |
getTargetDimension() |
void |
setAlpha(double alpha)
α is the "early exaggeration" constant.
|
void |
setIterations(int T)
Sets the desired number of gradient descent iterations to perform.
|
void |
setPerplexity(double perplexity)
Sets the target perplexity of the gaussian used over each data point.
|
boolean |
setTargetDimension(int target)
Sets the target dimension to embed new dataset to.
|
<Type extends DataSet> |
transform(DataSet<Type> d)
Transforms the given data set, returning a dataset of the same type.
|
<Type extends DataSet> |
transform(DataSet<Type> d,
ExecutorService ex)
Transforms the given data set, returning a dataset of the same type.
|
public void setAlpha(double alpha)
alpha
- the exaggeration constantpublic double getAlpha()
public void setPerplexity(double perplexity)
perplexity
- the quasi number of neighbors to consider for each data pointpublic double getPerplexity()
public void setIterations(int T)
T
- the number of gradient descent iterationspublic int getIterations()
public <Type extends DataSet> Type transform(DataSet<Type> d)
VisualizationTransform
transform
in interface VisualizationTransform
Type
- the dataset typed
- the data set to transformpublic <Type extends DataSet> Type transform(DataSet<Type> d, ExecutorService ex)
VisualizationTransform
transform
in interface VisualizationTransform
Type
- the dataset typed
- the data set to transformex
- the source of threads for parallel computationprotected static void computeP(DataSet d, ExecutorService ex, Random rand, int knn, int[][] nearMe, double[][] nearMePij, DistanceMetric dm, double perplexity)
d
- the dataset to searchex
- the source of threads for parallel computationrand
- source of randomnessknn
- the number of neighbors to search fornearMe
- each row is the set of knn indices returned by the NN searchnearMePij
- the symmetrized neighbor probabilitydm
- the distance metric to use for determining closenessperplexity
- the perplexity value for the effective nearest neighbor search and weightingpublic int getTargetDimension()
getTargetDimension
in interface VisualizationTransform
public boolean setTargetDimension(int target)
VisualizationTransform
setTargetDimension
in interface VisualizationTransform
target
- the new target dimension size when VisualizationTransform.transform(jsat.DataSet)
is called.true
if this transform supports that dimension and it was
set, false
if the target dimension is unsupported and the
previous value will be used instead.Copyright © 2017. All rights reserved.