예제 #1
0
 private Tuple<double, double> MinMaxTheta(double[][] data)
 {
     var features = new BSASFeatures(data);
     var clusterData = features.Select();
     double MinTheta = 500000;
     double MaxTheta = -500000;
     for (int i = 0; i < data.Length - 1; ++i)
     {
         double dist = Distance.Euclidean(clusterData[i], clusterData[i + 1]);
         if (dist < MinTheta)
         {
             MinTheta = dist;
         }
         if (dist > MaxTheta)
         {
             MaxTheta = dist;
         }
     }
     return Tuple.Create(MinTheta, MaxTheta);
 }
예제 #2
0
        private Tuple <double, double> MinMaxTheta(double[][] data)
        {
            var    features    = new BSASFeatures(data);
            var    clusterData = features.Select();
            double MinTheta    = 500000;
            double MaxTheta    = -500000;

            for (int i = 0; i < data.Length - 1; ++i)
            {
                double dist = Distance.Euclidean(clusterData[i], clusterData[i + 1]);
                if (dist < MinTheta)
                {
                    MinTheta = dist;
                }
                if (dist > MaxTheta)
                {
                    MaxTheta = dist;
                }
            }
            return(Tuple.Create(MinTheta, MaxTheta));
        }
예제 #3
0
 public KMeansClustering(double[][] data, int iterations, double thetaStepNum)
 {
     features       = new BSASFeatures(data);
     m_iterations   = iterations;
     m_thetaStepNum = thetaStepNum;
 }
예제 #4
0
 public KMeansClustering(double[][] data, int iterations, double thetaStepNum)
 {
     features = new BSASFeatures(data);
     m_iterations = iterations;
     m_thetaStepNum = thetaStepNum;
 }