public class MultidimensionalScaling extends Object implements SimilarityMatrixProcessor
Implementation originally based around Toby Segaran's python code.
Modifier and Type | Field and Description |
---|---|
protected int |
numIterations |
protected List<IndependentPair<String,Point2d>> |
points |
protected double |
rate |
protected Random |
rng |
Constructor and Description |
---|
MultidimensionalScaling()
Default constructor.
|
MultidimensionalScaling(int numIterations,
double rate)
Construct MDS with the given maximum number of iterations and rate.
|
MultidimensionalScaling(int numIterations,
double rate,
Random rng)
Construct MDS with the given maximum number of iterations, rate and
random number generator.
|
MultidimensionalScaling(Random rng)
Construct with the given random number generator and default learning
rate at 0.01 and the maximum number of iterations to 1000.
|
Modifier and Type | Method and Description |
---|---|
Point2d |
getPoint(String key)
Get the predicted point for a specific element.
|
List<IndependentPair<String,Point2d>> |
getPoints()
Get a list of the 2-D coordinates learned by the MDS algorithm for each
element in the input similarity matrix.
|
void |
process(SimilarityMatrix matrix)
Process the
SimilarityMatrix , making changes inplace. |
String |
toString() |
protected int numIterations
protected double rate
protected List<IndependentPair<String,Point2d>> points
public MultidimensionalScaling()
public MultidimensionalScaling(Random rng)
rng
- the random number generatorpublic MultidimensionalScaling(int numIterations, double rate)
numIterations
- number of iterationsrate
- learning ratepublic MultidimensionalScaling(int numIterations, double rate, Random rng)
numIterations
- number of iterationsrate
- learning raterng
- the random number generatorpublic void process(SimilarityMatrix matrix)
SimilarityMatrixProcessor
SimilarityMatrix
, making changes inplace.process
in interface SimilarityMatrixProcessor
matrix
- the matrix to process.public List<IndependentPair<String,Point2d>> getPoints()
public Point2d getPoint(String key)
key
- the element identifier