Examples of predict()


Examples of com.nr.ci.Svm.predict()

//        System.out.printf(test);
        k++;
      } while (test > 1.e-3 && k < 100);
      nerror=0;
      for (i=0;i<M;i++) {
        nerror += ((y[i]==1.0) != (linsvm2.predict(i) >= 0.0) ? 1 : 0);
      }
      System.out.printf("%d ",nerror);
      // Test new data
      nerror=0;
      for (j=0;j<4;j++) {   // Four quadrants
View Full Code Here

Examples of com.nr.ci.Svm.predict()

          } else {
            yy=-1.0;
            x[0]=1.0+ndev.dev();
            x[1]=-1.0+ndev.dev();
          }
          nerror += ((yy==1.0) != (linsvm2.predict(x) >= 0.0) ? 1 : 0);
        }
      }
      System.out.printf("%d    ",nerror);
    }
    System.out.println();
View Full Code Here

Examples of com.nr.ci.Svm.predict()

        k++;
      } while (test > 1.e-3 && k < 100);
      // Test training set
      nerror=0;
      for (i=0;i<M;i++) {
        nerror += ((y[i]==1.0) != (polysvm2.predict(i) >= 0.0) ? 1 : 0);
      }
      System.out.printf("%d ",nerror);
      // Test new data
      nerror=0;
      for (j=0;j<4;j++) {   // Four quadrants
View Full Code Here

Examples of com.nr.ci.Svm.predict()

          } else {
            yy=-1.0;
            x[0]=1.0+ndev.dev();
            x[1]=-1.0+ndev.dev();
          }
          nerror += ((yy==1.0) != (polysvm2.predict(x) >= 0.0) ? 1 : 0);
        }
      }
      System.out.printf("%d    ",nerror);
    }
    System.out.println();
View Full Code Here

Examples of com.nr.ci.Svm.predict()

//        System.out.printf(test);
        k++;
      } while (test > 1.e-3 && k < 100);
      nerror=0;
      for (i=0;i<M;i++) {
        nerror += ((y[i]==1.0) != (gausssvm2.predict(i) >= 0.0) ? 1 : 0);
      }
      System.out.printf("%d ",nerror);
      // Test new data
      nerror=0;
      for (j=0;j<4;j++) {   // Four quadrants
View Full Code Here

Examples of com.nr.ci.Svm.predict()

          } else {
            yy=-1.0;
            x[0]=1.0+ndev.dev();
            x[1]=-1.0+ndev.dev();
          }
          nerror += ((yy==1.0) != (gausssvm2.predict(x) >= 0.0) ? 1 : 0);
        }
      }
      System.out.printf("%d    ",nerror);
    }
    System.out.println();
View Full Code Here

Examples of edu.cmu.graphchi.apps.ALSMatrixFactorization.predict()

            double sumEstimatePos = 0.0;
            double sumEstimateNeg = 0.0;

            int n = Math.min(posTop.length, negTop.length);
            for(int j=0; j<n; j++) {
                sumEstimatePos += als.predict(userId, posTop[j].id);
                sumEstimateNeg += als.predict(userId, negTop[j].id);
            }


            long t = System.currentTimeMillis();
View Full Code Here

Examples of edu.cmu.graphchi.apps.ALSMatrixFactorization.predict()

            double sumEstimateNeg = 0.0;

            int n = Math.min(posTop.length, negTop.length);
            for(int j=0; j<n; j++) {
                sumEstimatePos += als.predict(userId, posTop[j].id);
                sumEstimateNeg += als.predict(userId, negTop[j].id);
            }


            long t = System.currentTimeMillis();
            // Compute all
View Full Code Here

Examples of edu.cmu.graphchi.apps.ALSMatrixFactorization.predict()

            // Compute all
            double allSum = 0;
            int numMovies = graphInfo.getNumRight();
            for(int m=0; m < numMovies; m++) {
                int movieId = vertexIdTranslate.forward(graphInfo.getNumLeft() + m);
                allSum += als.predict(userId, movieId);
            }

            System.out.println(i + " avg pos: " + sumEstimatePos / n + "; avg neg: " + sumEstimateNeg / n + "; all="
                    + allSum / graphInfo.getNumRight() + " (" + (System.currentTimeMillis() - t) + " ms for " + numMovies + " movies");
        }
View Full Code Here

Examples of edu.stanford.nlp.parser.nndep.DependencyParser.predict()

    DependencyParser parser = DependencyParser.loadFromModelFile(modelPath);

    DocumentPreprocessor tokenizer = new DocumentPreprocessor(new StringReader(text));
    for (List<HasWord> sentence : tokenizer) {
      List<TaggedWord> tagged = tagger.tagSentence(sentence);
      GrammaticalStructure gs = parser.predict(tagged);

      // Print typed dependencies
      System.err.println(gs);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.