Package org.hipparchus.samples
Class ClusterAlgorithmComparison
- java.lang.Object
-
- org.hipparchus.samples.ClusterAlgorithmComparison
-
public class ClusterAlgorithmComparison extends Object
Plots clustering results for various algorithms and datasets. Based on scikit learn.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClusterAlgorithmComparison.ClusterPlot
Plot component.static class
ClusterAlgorithmComparison.Display
Display frame.
-
Constructor Summary
Constructors Constructor Description ClusterAlgorithmComparison()
Empty constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Vector2D
generateNoiseVector(RandomGenerator randomGenerator, double noise)
Generate a random vector.static void
main(String[] args)
Example entry point.static List<Vector2D>
makeBlobs(int samples, int centers, double clusterStd, double min, double max, boolean shuffle, RandomGenerator random)
Make blobs patterns.static List<Vector2D>
makeCircles(int samples, boolean shuffle, double noise, double factor, RandomGenerator random)
Make circles patterns.static List<Vector2D>
makeMoons(int samples, boolean shuffle, double noise, RandomGenerator random)
Make Moons patterns.static List<Vector2D>
makeSobol(int samples)
Make Sobol patterns.static List<DoublePoint>
normalize(List<Vector2D> input, double minX, double maxX, double minY, double maxY)
Normolize points in a rectangular area
-
-
-
Method Detail
-
makeCircles
public static List<Vector2D> makeCircles(int samples, boolean shuffle, double noise, double factor, RandomGenerator random)
Make circles patterns.- Parameters:
samples
- number of pointsshuffle
- if true, shuffle pointsnoise
- noise to add to points positionfactor
- reduction factor from outer to inner circlerandom
- generator to use- Returns:
- circle patterns
-
makeMoons
public static List<Vector2D> makeMoons(int samples, boolean shuffle, double noise, RandomGenerator random)
Make Moons patterns.- Parameters:
samples
- number of pointsshuffle
- if true, shuffle pointsnoise
- noise to add to points positionrandom
- generator to use- Returns:
- Moons patterns
-
makeBlobs
public static List<Vector2D> makeBlobs(int samples, int centers, double clusterStd, double min, double max, boolean shuffle, RandomGenerator random)
Make blobs patterns.- Parameters:
samples
- number of pointscenters
- number of centersclusterStd
- standard deviation of clustermin
- range min valuemax
- range max valueshuffle
- if true, shuffle pointsrandom
- generator to use- Returns:
- blobs patterns
-
makeSobol
public static List<Vector2D> makeSobol(int samples)
Make Sobol patterns.- Parameters:
samples
- number of points- Returns:
- Moons patterns
-
generateNoiseVector
public static Vector2D generateNoiseVector(RandomGenerator randomGenerator, double noise)
Generate a random vector.- Parameters:
randomGenerator
- random generator to usenoise
- noise level- Returns:
- random vector
-
normalize
public static List<DoublePoint> normalize(List<Vector2D> input, double minX, double maxX, double minY, double maxY)
Normolize points in a rectangular area- Parameters:
input
- input pointsminX
- range min value in XmaxX
- range max value in XminY
- range min value in YmaxY
- range max value in Y- Returns:
- normalized points
-
main
public static void main(String[] args)
Example entry point.- Parameters:
args
- arguments (not used)
-
-