Documentation of 'medusa.spectral.KMeansPoint' Java class
KMeansPoint
medusa.spectral

Class KMeansPoint



  • public class KMeansPoint
    extends java.lang.Object
    Represents an abstraction for a data point in two dimensional space
    • Constructor Summary

      Constructors 
      Constructor and Description
      KMeansPoint(java.lang.String label, double[] coords) 
      KMeansPoint(java.lang.String label, double _x, double _y)
      Creates a new instance of data point
    • Constructor Detail

      • KMeansPoint

        public KMeansPoint(java.lang.String label,
                           double _x,
                           double _y)
        Creates a new instance of data point
        Parameters:
        _x - value in dimension x
        _y - value in dimension y
      • KMeansPoint

        public KMeansPoint(java.lang.String label,
                           double[] coords)
    • Method Detail

      • getDimensions

        public int getDimensions()
      • assignToCluster

        public void assignToCluster(int _clusterNumber)
        Assigns the data point to a cluster
        Parameters:
        _clusterNumber - the cluster to which this data point is to be assigned
      • getClusterNumber

        public int getClusterNumber()
        Returns the cluster to which the data point belongs
        Returns:
        the cluster number to which the data point belongs
      • getCoords

        public double[] getCoords()
      • distance

        public static double distance(KMeansPoint dp1,
                                      KMeansPoint dp2)
        Returns the distance between two data points
        Parameters:
        dp1 - the first data point
        dp2 - the second data point
        Returns:
        the distance between the two data points
      • toString

        public java.lang.String toString()
        Returns a string representation of this kMeansPoint
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this data point
      • toDataString

        public java.lang.String toDataString()
      • main

        public static void main(java.lang.String[] args)
        Main method -- to test the kMeansPoint class
        Parameters:
        args - command line arguments
      • getLabel

        public java.lang.String getLabel()

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.