Package Jama

Examples of Jama.Matrix


          1. Take first transformation from subShape (has smallest angle)
          2. Create second triplets
          3. For each combination of points create transformation and test
        */

        Matrix A = new Matrix(6, 6);
        Matrix b = new Matrix(6, 1);
        Matrix solution;
        Matrix subsolution = new Matrix(2, 2);
        Point2D transformedPoint = new Point2D.Double();

        // output transform
        AffineTransform outTransform = new AffineTransform();

        int[] fromIndexes = new int[3];

        // TODO: REDO
        fromIndexes[0] = 0;
        fromIndexes[1] = 1;
        fromIndexes[2] = 2;

        // create left matrix
        // 1st row
        IntersectionTriplet fromTriplet = from.getTriplet();

        A.set(0, 0, from.getIntersection().getX());
        A.set(0, 1, from.getIntersection().getY());
        A.set(0, 2, 1);
        // 2nd
        A.set(1, 3, from.getIntersection().getX());
        A.set(1, 4, from.getIntersection().getY());
        A.set(1, 5, 1);
        // 3rd
        A.set(2, 0, fromTriplet.getPointA().getX());
        A.set(2, 1, fromTriplet.getPointA().getY());
        A.set(2, 2, 1);
        // 4th
        A.set(3, 3, fromTriplet.getPointA().getX());
        A.set(3, 4, fromTriplet.getPointA().getY());
        A.set(3, 5, 1);
        // 5th
        A.set(4, 0, fromTriplet.getPointB().getX());
        A.set(4, 1, fromTriplet.getPointB().getY());
        A.set(4, 2, 1);
        // 6th
        A.set(5, 3, fromTriplet.getPointB().getX());
        A.set(5, 4, fromTriplet.getPointB().getY());
        A.set(5, 5, 1);

        // now find all intersection points in shape with same angle and ratio as original intersection
        IntersectionModel to;
        ArrayList<IntersectionTriplet> intersectionPairs;
        IntersectionTriplet currentPair;

        //Debugger.getInstance().addMessage("Init pair: " + from.getIntersection().toString() + fromTriplet.toString());

        // show markers
        //System.out.println("MARKERS");
        for (MarkerModel model : shape.getMarkers()) {
          Debugger.getInstance().addMessage(model.getLocation().toString());
        }
       
        // get itersections with the same angle
        toIntersections = shape.getIntersections(from.getAngle());     
       
        ExecutionReport.setGoodIntersections(toIntersections.size());
        long triplets = 0;
        for (IntersectionModel intr : toIntersections) {
          ArrayList<IntersectionTriplet> arr = intr.getTriplets(fromTriplet.getRatio());
          if (arr != null) {
            triplets += arr.size();
          }
        }
        ExecutionReport.setTriplets(triplets);
       
        // intersections are ordered by the angle
        // we start with the smallest angle and continue to the top limit
        for (int tos = 0; tos < toIntersections.size(); tos++) {
            ExecutionReport.intersectionTested();
           
          //monitor.setTaskName("Checking " + (tos + 1) + ". intersection");       
            if (monitor.isCanceled()) {
              return subShapes;
            }
           
          // initial validation
            to = toIntersections.get(tos);

            Debugger.getInstance().addMessage("=================================");
            Debugger.getInstance().addMessage("Intersection: " + to.getIntersection());
           
//            // we stop if we've reached bigger angle
//            if (to.getAngle() > from.getAngle()) {
//                break;
//            }
//
//            // we continue to search for the exact angle and ratio
//            if (to.getAngle() < from.getAngle()) {
//                continue;
//            }

            // now we have an intersection with the good angle
            // we will search for all points on carriers that have the same ratio as the
            // initial intersection triplet
            // intersection is defined by point and two carriers
            intersectionPairs = to.getTriplets(fromTriplet.getRatio());
                    
           
            // there exist no triplets on carriers with given ratio
            if (intersectionPairs == null)
                continue;

            // iterate for all found pairs
            for (int pair = 0; pair < intersectionPairs.size(); pair++) {
              ExecutionReport.tripletTested();
             
              //monitor.subTask("Checking intersection triplets");
              if (monitor.isCanceled()) {
                  return subShapes;
                }
             
                // get current pair
                currentPair = intersectionPairs.get(pair);                           
               
                Debugger.getInstance().addMessage("Pair: " + currentPair);             
                Debugger.getInstance().addMessage("TESTING: " + to.getIntersection().toString() + currentPair.toString());
               
                // we test this 2 times (once when we flip pointA and pointB (symmetry))
                // TODO: Test ratio .. if by flip does not change continue
                for (int j = 0; j < 1; j++) {
//                  if (monitor.isCanceled()) {
//                      return subShapes;
//                    }
                 
                  // this counter is to see how much transformations were tested


                    b.set(0, 0, to.getIntersection().getX());
                    b.set(1, 0, to.getIntersection().getY());
                    b.set(2, 0, j == 0 ? currentPair.getPointA().getX() : currentPair.getPointB().getX());
                    b.set(3, 0, j == 0 ? currentPair.getPointA().getY() : currentPair.getPointB().getY());
                    b.set(4, 0, j == 0 ? currentPair.getPointB().getX() : currentPair.getPointA().getX());
                    b.set(5, 0, j == 0 ? currentPair.getPointB().getY() : currentPair.getPointA().getY());

                    // create transformation by solving equation of 6 unknowns
                    try {
                        solution = A.solve(b);
                    }
                    catch (Exception ex) {
                      Debugger.getInstance().addMessage("Solution exception");
                        continue;
                    }

                    // check if it's symmetry
                    // first check determinant .. must be -1
                    subsolution.set(0, 0, solution.get(0, 0));
                    subsolution.set(0, 1, solution.get(1, 0));
                    subsolution.set(1, 0, solution.get(3, 0));
                    subsolution.set(1, 1, solution.get(4, 0));

                    // Symmetry: MathUtils.round(subsolution.det()) == -1)
                    // Inverse: MathUtils.isIdentity(subsolution.times(subsolution.transpose()))
                    if (MathUtils.round(subsolution.det()) == 0)
                        continue;

                    // we round transformations to 3 decimal places
                    outTransform.setTransform(
                        solution.get(0, 0),
View Full Code Here


           { 0, 0, 0, originalP1.getX(), originalP1.getY(), 1 }
           { originalP2.getX(), originalP2.getY(), 1, 0, 0, 0 },
           { 0, 0, 0, originalP2.getX(), originalP2.getY(), 1 },
           { originalP3.getX(), originalP3.getY(), 1, 0, 0, 0 },
           { 0, 0, 0, originalP3.getX(), originalP3.getY(), 1 }};       
        Matrix A = new Matrix(arrayA);
       
        double[][] arrayB =
        {{ newP1.getX() },
         { newP1.getY() },
         { newP2.getX() },
         { newP2.getY() },
         { newP3.getX() },
         { newP3.getY() }};
        Matrix b = new Matrix(arrayB);       

        try {
          // solve transformation
          Matrix solution = A.solve(b);
         
          // set transform
            transform = new AffineTransform(
              solution.get(0, 0),
                  solution.get(3, 0),
                  solution.get(1, 0),
                  solution.get(4, 0),
                  solution.get(2, 0),
                  solution.get(5, 0));
           
            return transform;
      }
      catch (Exception ex) {
        ex.printStackTrace();
View Full Code Here

        totals[i] = 0.0;
        nullClusters++;
      }
    }
    int newClusterNo = clusterNo - nullClusters;
    Matrix newClusters = new Matrix(newClusterNo, points, 0.0);
    int newCluster = 0;
    for(int i=0;i<clusterNo;i++) {
      if(totals[i] > 1.0) {
        double tot = totals[i];
        for(int j=0;j<points;j++) newClusters.set(newCluster, j, clusters.get(i, j) / tot);
        newCluster++;
      }
    }
    System.out.println(nullClusters + " null clusters, " + newClusterNo + " good clusters");
    return newClusters;
View Full Code Here

    System.out.println(nullClusters + " null clusters, " + newClusterNo + " good clusters");
    return newClusters;
  }

  public static List<List<Integer>> kmc(Matrix m, int clusterNo) throws Exception {
    Matrix clusters = korcmeans(m, clusterNo, true, 1.0, 1.0);
    List<List<Integer>> foundClusters = new ArrayList<List<Integer>>();
    for(int i=0;i<clusterNo;i++) {
      foundClusters.add(new ArrayList<Integer>());
    }
    for(int i=0;i<clusters.getRowDimension();i++) {
      for(int j=0;j<clusters.getColumnDimension();j++) {
        if(clusters.get(i, j) > 0) {
          foundClusters.get(i).add(j);
        }
      }
    }
    return foundClusters;
View Full Code Here

    }
    return foundClusters;
  }
 
  public static List<Map<Integer,Float>> cmc(Matrix m, int clusterNo, double fuzzy, double cutoff, double minMax) throws Exception {
    Matrix clusters = korcmeans(m, clusterNo, false, fuzzy, minMax);
    List<Map<Integer,Float>> foundClusters = new ArrayList<Map<Integer,Float>>();
    for(int i=0;i<clusters.getRowDimension();i++) {
      Map<Integer,Float> cluster = new HashMap<Integer,Float>();
      for(int j=0;j<clusters.getColumnDimension();j++) {
        if(clusters.get(i, j) > cutoff) {
          cluster.put(j, (float)clusters.get(i, j));
        }
      }
      foundClusters.add(cluster);
    }
    return foundClusters;   
View Full Code Here

  private static Matrix korcmeans(Matrix m, int clusterNo, boolean kmeans, double fuzzy, double minMax) throws Exception {
    System.out.println("Trying " + clusterNo + " clusters");
    int dimensions = m.getColumnDimension();
    int points = m.getRowDimension();
   
    Matrix clusters = new Matrix(clusterNo, points, 0.0);
    PrintWriter pw = new PrintWriter(System.out);
    //if(true) return;
   
    Random rand = new Random(3);
    for(int i=0;i<clusters.getRowDimension();i++) {
      for(int j=0;j<clusters.getColumnDimension();j++) {
        clusters.set(i, j, Math.pow(rand.nextDouble(), 3));
      }
    }
    //for(int i=0;i<points;i++) {
    //  clusters.set(rand.nextInt(clusterNo), i, 1.0);
    //}

    //clusters.print(pw, 6, 4);
    pw.flush();
   
    boolean converged = false;
    boolean firstRound = true;
    while(!converged) {
      Matrix oldClusters = clusters;
      boolean lostClusters = false;
      clusters = normalizedClusters(clusters, !firstRound, kmeans, minMax);
      if(clusterNo != clusters.getRowDimension()) {
        clusterNo = clusters.getRowDimension();
        lostClusters = true;
      }
      Matrix centroids = clusters.times(m);
      Matrix newClusters = new Matrix(clusterNo, points, 0.0);
      for(int i=0;i<points;i++) {
        // KMeans - always do on first round to get some clusters going
        if(kmeans || firstRound) {
          int bestCluster = -1;
          double shortestDistance = Double.POSITIVE_INFINITY;
          for(int j=0;j<clusterNo;j++) {
            // Euclidian distance
            double distSquared = 0.0;
            for(int k=0;k<dimensions;k++) {
              distSquared += Math.pow(centroids.get(j, k) - m.get(i, k), 2.0);
            }
            double dist = Math.sqrt(distSquared);
            if(dist < shortestDistance) {
              shortestDistance = dist;
              bestCluster = j;
            }
          }
          newClusters.set(bestCluster, i, 1.0);         
        } else {
          // Fuzzy c-means
          double [] dists = new double[clusterNo];
         
          for(int j=0;j<clusterNo;j++) {
            // Euclidian distance
            double distSquared = 0.0;
            for(int k=0;k<dimensions;k++) {
              distSquared += Math.pow(centroids.get(j, k) - m.get(i, k), 2.0);
            }
            double dist = Math.sqrt(distSquared);
            dists[j] = dist;
          }
          double titid = 0.0;
          for(int j=0;j<clusterNo;j++) {
            double tid = 0.0;
            for(int k=0;k<clusterNo;k++) {
              tid += Math.pow(dists[j] / dists[k], 2.0 / (fuzzy - 1.0));
            }
            newClusters.set(j, i, 1 / tid);
            titid += 1 / tid;
          }
        }
      }
      pw.flush();
      boolean different = false;
      if(firstRound) {
        firstRound = false;
        different = true;
      } else if(lostClusters) {
        different = true;
      } else {
        double totsqrdiff = 0.0;
       
        for(int i=0;i<clusters.getRowDimension();i++) {
          for(int j=0;j<clusters.getColumnDimension();j++) {
            totsqrdiff += Math.pow(oldClusters.get(i,j) - newClusters.get(i, j), 2);
          }
        }
        double rmsd = Math.sqrt(totsqrdiff / clusters.getRowDimension() / clusters.getColumnDimension());
        System.out.println("RMSD: " + rmsd);
        if((kmeans && rmsd > 0.0) || (!kmeans && rmsd > 1.0E-3)) different = true;
View Full Code Here

  private Matrix getMatrix(BufferedReader br) throws Exception {
    String line = br.readLine();
    String [] params = line.split("\\s+");
    int mrows = Integer.parseInt(params[0]);
    int mcols = Integer.parseInt(params[1]);
    Matrix m = new Matrix(mrows, mcols);
    line = br.readLine();
    for(int i=0;i<mrows;i++) {
      String [] vals = line.split("\\s+");
      for(int j=0;j<vals.length;j++) {
        m.set(i, j, Double.parseDouble(vals[j]));
      }
      line = br.readLine();
    }
    assert(line == null);
    return m;
View Full Code Here

      wordNo++;
    }
    System.out.println("Harness ready...");
    int values = 50;
    svdh.svd(values);
    Matrix ut = svdh.getUt(); // Terms
    //Matrix vt = svdh.getVt(); // Features
   
    //System.out.println(ut.getColumnDimension() + "\t" + ut.getRowDimension());
    //System.out.println(vt.getColumnDimension() + "\t" + vt.getRowDimension());
    //System.out.println(wordNo);
    //System.out.println(featureList.size());
   
    UnivariateStatistic mean = new Mean();
    UnivariateStatistic stdev = new StandardDeviation();
    List<Double> cmeans = new ArrayList<Double>();
    List<Double> cstdevs = new ArrayList<Double>();
    List<Double> ncmeans = new ArrayList<Double>();
    List<Double> ncstdevs = new ArrayList<Double>();
    int ccount = 0;
    int nccount = 0;
    for(int i=0;i<values;i++) {
      Map<String,Double> results = new HashMap<String,Double>();
      for(int j=0;j<wordNo;j++) {
        results.put(terms.get(j), ut.get(i,j));
      }
      List<String> resultsList = StringTools.getSortedList(results);
      for(String s : resultsList.subList(0, 20)) {
        System.out.println(s + "\t" + results.get(s));
      }
      System.out.println("...");
      for(String s : resultsList.subList(resultsList.size()-20, resultsList.size())) {
        System.out.println(s + "\t" + results.get(s));
      }
      List<Double> chemScores = new ArrayList<Double>();
      List<Double> nonChemScores = new ArrayList<Double>();
      List<Double> allScores = new ArrayList<Double>();
      for(int j=500;j<1000;j++) {
        boolean isChem = chemSet.contains(terms.get(j));
        //System.out.println(isChem);
        List<Double> list = isChem ? chemScores : nonChemScores;
        list.add(ut.get(i,j));
        allScores.add(ut.get(i,j));
      }
      System.out.println(chemScores.size() + "\t" + nonChemScores.size());
      double [] cs = new double[chemScores.size()];
      for(int j=0;j<chemScores.size();j++) cs[j] = chemScores.get(j);
      double [] ncs = new double[nonChemScores.size()];
      for(int j=0;j<nonChemScores.size();j++) ncs[j] = nonChemScores.get(j);
      double [] as = new double[allScores.size()];
      for(int j=0;j<allScores.size();j++) as[j] = allScores.get(j);
      System.out.println(mean.evaluate(cs) + "\t" + stdev.evaluate(cs));
      System.out.println(mean.evaluate(ncs) + "\t" + stdev.evaluate(ncs));
      cmeans.add(mean.evaluate(cs));
      cstdevs.add(stdev.evaluate(cs));
      ncmeans.add(mean.evaluate(ncs));
      ncstdevs.add(stdev.evaluate(ncs));
      System.out.println();
      ccount = cs.length;
      nccount = ncs.length;
    }
    double cp = ccount / (0.0 + ccount + nccount);
    double ncp = 1.0 - cp;
   
    ClassificationEvaluator ce = new ClassificationEvaluator();
    for(int j=0;j<500;j++) {
      double thiscp = Math.log(cp);
      double thisncp = Math.log(ncp);
      for(int i=0;i<values;i++) {
        thiscp += Math.log(pdf(ut.get(i,j), cmeans.get(i), cstdevs.get(i)));
        thisncp += Math.log(pdf(ut.get(i,j), ncmeans.get(i), ncstdevs.get(i)));
      }
      String refClass = chemSet.contains(terms.get(j)) ? "CHEM" : "NONCHEM";
      String respClass = thiscp > thisncp ? "CHEM" : "NONCHEM";
      System.out.println(terms.get(j) + "\t" + (thiscp - thisncp));
      ce.logEvent(refClass, respClass);
View Full Code Here

    }
   
    time = System.currentTimeMillis();
    if(true) {   
      Set<Integer> assigned = new HashSet<Integer>();
      Matrix docMatrix = svdh.getVt().transpose();
      SimilarityMatrix simMatrix = new SimilarityMatrix(docFiles);
      for(int i=0;i<docFiles.size();i++) {
        for(int j=i+1;j<docFiles.size();j++) {
          simMatrix.setSimilarity(i, j, (float)cosine(docMatrix, i, j, svals));
          //simMatrix.setSimilarity(i, j, (float)tanimoto(docMatrix, i, j, svals));
        }
      }
      //System.out.println(Math.min(svals.length, docMatrix.getRowDimension()));
      //VirtualSimilarityMatrix simMatrix = new VirtualSimilarityMatrix(docMatrix, docFiles, Math.min(svals.length, docMatrix.getRowDimension()-1));
      System.out.println("Similarity matrix: " + (System.currentTimeMillis() - time));
      time = System.currentTimeMillis();     
      QTClusterer qt = new QTClusterer(simMatrix);
      qt.makeClusters(0.05);
      System.out.println("Made clusters in: " + (System.currentTimeMillis() - time));
      for(Set<Integer> cluster : qt.getClustersBySize()) {
        /*double[] fuzzyVector = vectorToPoints(combinedVector(cluster, docMatrix, svals), docMatrix, svals);
        double fvt = 0.0;
        Map<Integer,Float> fc = new HashMap<Integer,Float>();
        for(int i=0;i<fuzzyVector.length;i++) {
          fvt += fuzzyVector[i];
          //if(cluster.contains(i)) System.out.println(docFiles.get(i) + "\t" + fuzzyVector[i]);
          //if(fuzzyVector[i] > 0.1 && !cluster.contains(i)) System.out.println(docFiles.get(i) + "\t" + fuzzyVector[i]);
          //if(fuzzyVector[i] > 0.05 && !cluster.contains(i)) {
          //  cluster.add(i);
          //  assigned.add(i);
          //}
          if(fuzzyVector[i] > 0.25) fc.put(i, (float)fuzzyVector[i]);
        }*/
        //System.out.println(fvt);
        for(Integer i : cluster) {
          System.out.println(docFiles.get(i));
        }
        Map<Integer,Float> clusterMap = new HashMap<Integer,Float>();
        for(Integer i : cluster) {
          clusterMap.put(i, 1.0f);
        }

        //ClusterAnalyser.analyseCluster(fc, ir);
        //ClusterAnalyser.analyseCluster(new ArrayList<Integer>(cluster), ir, new TanimotoSimilarity(), 0.05);
        ClusterAnalyser.excessAnalyseCluster(clusterMap, ir, 0.2, true);
        System.out.println();
      }
     
      for(Integer i : qt.getUnclustered()) {
        if(!assigned.contains(i)) System.out.println(docFiles.get(i));
      }
      return;
    }
   
    Matrix lm = svdh.getUt().transpose();
    Matrix sm = svdh.getVt().transpose();

    if(true) {
      Map<Integer,List<Integer>> clusters = new HashMap<Integer,List<Integer>>();
      for(int i=0;i<docFiles.size();i++) {
        double maxScore = 0.0;
        int cnum = 0;
        for(int j=0;j<svals.length;j++) {
          double score = sm.get(i, j) * svals[j];
          if(score > maxScore) {
            cnum = j;
            maxScore = score;
          } else if(-score > maxScore) {
            cnum = -j;
            maxScore = -score;
          }
        }
        if(!clusters.containsKey(cnum)) clusters.put(cnum, new ArrayList<Integer>());
        clusters.get(cnum).add(i);
      }
      for(int i=0;i<svals.length;i++) {
        if(clusters.containsKey(i)) {
          System.out.println(i);
          for(Integer j : clusters.get(i)) {
            System.out.println(docFiles.get(j));
          }
          ClusterAnalyser.analyseCluster(clusters.get(i), ir, new TanimotoSimilarity(), 0.05);
          System.out.println();
        }
        if(i > 0 && clusters.containsKey(-i)) {
          System.out.println(-i);
          for(Integer j : clusters.get(-i)) {
            System.out.println(docFiles.get(j));
          }
          ClusterAnalyser.analyseCluster(clusters.get(-i), ir, new TanimotoSimilarity(), 0.05);
          System.out.println();
        }
      }
    }
   
    if(false) {
      File outFile = new File("lsa.csv");
      PrintWriter out = new PrintWriter(new FileWriter(outFile));
      Map<String,Double> distances = new HashMap<String,Double>();
     
      for(int i=0;i<dfl.size();i++) {
        out.print(dfl.get(i));
        for(int j=0;j<svals.length;j++) {
          out.print("\t" + lm.get(i, j));
        }
        out.println();
        double squareLength = 0.0;
        for(int j=0;j<lm.getColumnDimension();j++) {
          squareLength += Math.pow(lm.get(i, j), 2);
        }
        double distance = Math.sqrt(squareLength);
        String term = dfl.get(i);
        int docFreq = ir.docFreq(new Term("txt", term));
        double score = Math.log(docFreq) * distance;
        if(score > 1.0) distances.put(dfl.get(i), score);
      }
      out.close();
     
      for(String topicWord : StringTools.getSortedList(distances)) {
        System.out.println(topicWord + "\t" + distances.get(topicWord));
        int termNo = termIndex.get(topicWord);
        describeTerm(termNo, lm, svals, dfl);
      }     
    }
   

    if(false) {
      for(int i=0;i<svals.length;i++) {
        //System.out.println(svals[i]);
        for(int j=0;j<sm.getRowDimension();j++) {
          sm.set(j, i, sm.get(j, i) * svals[i]);
        }
      }     
    }

    if(false) {
      for(int i=0;i<sm.getRowDimension();i++) {
        double [] v = getVector(sm, i);
        System.out.println(ir.document(i).getField("filename").stringValue().replaceAll("markedup", "source"));
        describeVector(v, lm, svals, dfl);
      }
    }
View Full Code Here

      vectors.add(vector);
    }
    System.out.println("Read vectors in: " + (System.currentTimeMillis() - time));
    time = System.currentTimeMillis();
   
    Matrix matrix = new Matrix(vectors.size(), vectors.size());
   
    //Map<String,Double> cosines = new HashMap<String,Double>();
    for(int i=0;i<vectors.size();i++) {
    //for(int i=0;i<50;i++) {
      //System.out.println(i);
      matrix.set(i, i, 1.0);
      for(int j=i+1;j<vectors.size();j++) {
        double cosine = cosine(vectors.get(i), vectors.get(j));
        //if(cosine > 0.05) cosines.put(i + " -> " + j, cosine);
        matrix.set(i, j, cosine);
        matrix.set(j, i, cosine);
        //cosines.put(i + " -> " + j, cosine);
      }
    }
   
    System.out.println("Cosines calculated in: " + (System.currentTimeMillis() - time));
    time = System.currentTimeMillis();

    //laplacianise(matrix);
   
   
    EigenvalueDecomposition evd = matrix.eig();
    System.out.println("evd in: " + (System.currentTimeMillis() - time));
    double [] evr = evd.getRealEigenvalues();   
    Matrix evm = evd.getV();

    int evnum = evr.length;

    for(int i=0;i<evr.length;i++) {
      if(evr[i] <= 1.0) {
        evnum--;
      } else {
        break;
      }
    }
   
    System.out.println("Using " + evnum + " eigenvectors");
   
    Matrix sm = evm.getMatrix(0, evm.getRowDimension()-1, evm.getColumnDimension()-evnum, evm.getColumnDimension()-1);
   
    for(int i=0;i<evnum;i++) {
      for(int j=0;j<evr.length;j++) {
        sm.set(j, evnum-i-1, sm.get(j, evnum-i-1) * (evr[evr.length-i-1] - 1.0));
      }
    }
    // 1.14 = moderate fuzzy
    List<Map<Integer,Float>> clusters = KMeans.cmc(sm, evnum, 1.05, 0.1, 0.5);
    for(Map<Integer,Float> cluster : clusters) {
View Full Code Here

TOP

Related Classes of Jama.Matrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.