public final class Tsne
extends java.lang.Object
| Constructor and Description |
|---|
Tsne()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getInitialDims()
Returns the initial dimensions.
|
int |
getMaxIterations()
Returns the maximum number of iterations that will be performed.
|
java.util.function.Consumer<? super java.lang.String> |
getMessageConsumer()
Returns the consumer for the messages
|
int |
getOutputDims()
Returns the number of output dimensions
|
double |
getPerplexity()
Returns the perplexity.
|
java.util.function.DoubleConsumer |
getProgressConsumer()
Returns the progress consumer
|
long |
getRandomSeed()
Returns the random seed
|
double |
getTheta()
Returns the theta parameter.
|
double[][] |
run(double[][] input)
Performs the t-SNE on the given input data, and returns the result.
|
void |
setInitialDims(int initialDims)
Set the number of initial dimensions.
|
void |
setMaxIterations(int maxIterations)
Set the maximum number of iterations that will be performed.
|
void |
setMessageConsumer(java.util.function.Consumer<? super java.lang.String> messageConsumer)
Set an optional consumer for the messages that are emitted by the
underlying implementation.
|
void |
setOutputDims(int outputDims)
Set the output dimensions.
|
void |
setPerplexity(double perplexity)
Set the perplexity.
|
void |
setProgressConsumer(java.util.function.DoubleConsumer progressConsumer)
Set an optional consumer for the progress of the iterations.
|
void |
setRandomSeed(long randomSeed)
Set the random seed.
|
void |
setTheta(double theta)
Set this theta parameter.
|
public Tsne()
output dimensions will be 2.maximum iterations will be 1000.perplexity will be 20.0.theta will be 0.5.initial dimensions will be 55.random seed will be 0.setMessageConsumer(null).public void setOutputDims(int outputDims)
outputDims - The output dimensionsjava.lang.IllegalArgumentException - If the given number is not positivepublic int getOutputDims()
public void setMaxIterations(int maxIterations)
maxIterations - The maximum number of iterationsjava.lang.IllegalArgumentException - If the given number is not positivepublic int getMaxIterations()
setMaxIterations(int) for details.public void setInitialDims(int initialDims)
initialDims - The initial dimensionspublic int getInitialDims()
setInitialDims(int) for
details.public void setPerplexity(double perplexity)
numberOfInputPoints - 1 > 3 * perplexity
must hold, otherwise, the underlying implementation will throw
an exception.perplexity - The perplexitypublic double getPerplexity()
setPerplexity(double) for details.public void setTheta(double theta)
theta - The theta parameter.java.lang.IllegalArgumentException - If the given number is not positivepublic double getTheta()
setTheta(double) for details.public void setRandomSeed(long randomSeed)
0, causing
the same results to be generated each time. In order to generate
different results, the random seed may be set to different values.randomSeed - The random seedpublic long getRandomSeed()
public void setProgressConsumer(java.util.function.DoubleConsumer progressConsumer)
progressConsumer - The progress consumerpublic java.util.function.DoubleConsumer getProgressConsumer()
public void setMessageConsumer(java.util.function.Consumer<? super java.lang.String> messageConsumer)
messageConsumer - The message consumerpublic java.util.function.Consumer<? super java.lang.String> getMessageConsumer()
public double[][] run(double[][] input)
input - The input datanull if the calling thread was
interruptedCopyright © 2020. All Rights Reserved.