jsat.datatransform.visualization
Class LargeViz
- java.lang.Object
-
- jsat.datatransform.visualization.LargeViz
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, VisualizationTransform
public class LargeViz extends java.lang.Object implements VisualizationTransform
LargeViz is an algorithm for creating low dimensional embeddings for visualization. It is meant to be faster and better quality thant-SNEwithout requiring any parameter tuning to get good results. LargeViz is related to t-SNE in how the neighbor graph is constructed, and theperplexityparameter for LargeViz has the same meaning and impact as the perplexity parameter in t-SNE.
NOTE: The origina LargeViz paper includes a faster scheme for approximately constructing the nearest neighbor graph. This is not yet implemented, but has no negative impact on the quality of the result.
See: Tang, J., Liu, J., Zhang, M., & Mei, Q. (2016). Visualizing Large-scale and High-dimensional Data. In Proceedings of the 25th International Conference on World Wide Web (pp. 287–297). Republic and Canton of Geneva, Switzerland: International World Wide Web Conferences Steering Committee. doi:10.1145/2872427.2883041- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description LargeViz()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetGamma()intgetNegativeSamples()doublegetPerplexity()intgetTargetDimension()voidsetDistanceMetricEmbedding(DistanceMetric dm)Sets the distance metric to use for the embedded space.voidsetDistanceMetricSource(DistanceMetric dm)Sets the distance metric to use for the original space.voidsetGamma(double gamma)Gamma controls the negative weight assigned to negative edges in the optimization problem.voidsetNegativeSamples(int M)Sets the number of negative neighbor samples to obtain for each data point.voidsetPerplexity(double perplexity)Sets the target perplexity of the gaussian used over each data point.booleansetTargetDimension(int target)Sets the target dimension to embed new dataset to.<Type extends DataSet>
Typetransform(DataSet<Type> d, boolean parallel)Transforms the given data set, returning a dataset of the same type.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.datatransform.visualization.VisualizationTransform
transform
-
-
-
-
Method Detail
-
setPerplexity
public void setPerplexity(double perplexity)
Sets the target perplexity of the gaussian used over each data point. The perplexity can be thought of as a quasi desired number of nearest neighbors to be considered, but is adapted based on the distribution of the data. Increasing the perplexity can increase the amount of time it takes to get an embedding. Using a value in the range of [5, 100] is recommended.- Parameters:
perplexity- the quasi number of neighbors to consider for each data point
-
getPerplexity
public double getPerplexity()
- Returns:
- the target perplexity to use for each data point
-
setDistanceMetricSource
public void setDistanceMetricSource(DistanceMetric dm)
Sets the distance metric to use for the original space. This will determine the target nearest neighbors to keep close to each other in the embedding space- Parameters:
dm- the distance metric to use
-
setDistanceMetricEmbedding
public void setDistanceMetricEmbedding(DistanceMetric dm)
Sets the distance metric to use for the embedded space. This will determine the actual nearest neighbors as the occur in the embedded space.- Parameters:
dm- the distance metric to use
-
setNegativeSamples
public void setNegativeSamples(int M)
Sets the number of negative neighbor samples to obtain for each data point. The default recommended value is 5.- Parameters:
M- the number of negative samples to use for each update
-
getNegativeSamples
public int getNegativeSamples()
- Returns:
- the number of negative samples to use for each update
-
setGamma
public void setGamma(double gamma)
Gamma controls the negative weight assigned to negative edges in the optimization problem. Large values will place a higher emphasis on separating non-neighbors in the embedded space. The default recommend value is 7.- Parameters:
gamma- the weight for negative edge samples
-
getGamma
public double getGamma()
- Returns:
- the weight for negative edge samples
-
getTargetDimension
public int getTargetDimension()
- Specified by:
getTargetDimensionin interfaceVisualizationTransform- Returns:
- the number of dimensions that a dataset will be embedded down to
-
setTargetDimension
public boolean setTargetDimension(int target)
Description copied from interface:VisualizationTransformSets the target dimension to embed new dataset to. Many visualization methods may only support a target of 2 or 3 dimensions, or only one of those options. For that reason a boolean value will be returned indicating if the target size was acceptable. If not, no change to the object will occur.- Specified by:
setTargetDimensionin interfaceVisualizationTransform- Parameters:
target- the new target dimension size whenVisualizationTransform.transform(jsat.DataSet)is called.- Returns:
trueif this transform supports that dimension and it was set,falseif the target dimension is unsupported and the previous value will be used instead.
-
transform
public <Type extends DataSet> Type transform(DataSet<Type> d, boolean parallel)
Description copied from interface:VisualizationTransformTransforms the given data set, returning a dataset of the same type.- Specified by:
transformin interfaceVisualizationTransform- Type Parameters:
Type- the dataset type- Parameters:
d- the data set to transformparallel-trueif transform should be done in parallel, orfalseif it should use a single thread.- Returns:
- the lower dimension dataset for visualization.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG