Examples of svm_problem


Examples of libsvm.svm_problem

      }
      if (m > 0)
        max_index = Math.max(max_index, x[m - 1].index);
      vx.addElement(x);
    }
    prob = new svm_problem();
    prob.l=vy.size();
    prob.y = new double[prob.l];
    prob.x = new svm_node[prob.l][];
    for (int i = 0; i < prob.l; i++)
      prob.x[i]= (svm_node[]) vx.elementAt(i);
View Full Code Here

Examples of libsvm.svm_problem

        param.probability = 0;
        param.nr_weight = 0;
        param.weight_label = new int[0];
        param.weight = new double[0];

        svm_problem problem = toSvmProblem(dataset);

        //TODO: we should probably run this in another thread, and put a bound on the running time
        model = svm.svm_train(problem, param);
    }
View Full Code Here

Examples of libsvm.svm_problem

    protected abstract int getLibsvmType();

    private static svm_problem toSvmProblem(Dataset dataset)
    {
        svm_problem problem = new svm_problem();
        List<Double> labels = dataset.getLabels();
        problem.l = labels.size();
        problem.y = new double[labels.size()];
        for (int i = 0; i < labels.size(); i++) {
            problem.y[i] = labels.get(i);
View Full Code Here

Examples of libsvm.svm_problem

    @Override
    public void train(Dataset dataset)
    {
        params.svm_type = getLibsvmType();

        svm_problem problem = toSvmProblem(dataset);

        ExecutorService service = newCachedThreadPool(threadsNamed("libsvm-trainer-" + System.identityHashCode(this) + "-%d"));
        try {
            TimeLimiter limiter = new SimpleTimeLimiter(service);
            //TODO: this time limit should be configurable
View Full Code Here

Examples of libsvm.svm_problem

    protected abstract int getLibsvmType();

    private static svm_problem toSvmProblem(Dataset dataset)
    {
        svm_problem problem = new svm_problem();
        List<Double> labels = dataset.getLabels();
        problem.l = labels.size();
        problem.y = new double[labels.size()];
        for (int i = 0; i < labels.size(); i++) {
            problem.y[i] = labels.get(i);
View Full Code Here

Examples of libsvm.svm_problem

    @Override
    public void train(Dataset dataset)
    {
        params.svm_type = getLibsvmType();

        svm_problem problem = toSvmProblem(dataset);

        ExecutorService service = Executors.newCachedThreadPool(Threads.threadsNamed("libsvm-trainer-" + System.identityHashCode(this) + "-%d"));
        try {
            TimeLimiter limiter = new SimpleTimeLimiter(service);
            //TODO: this time limit should be configurable
View Full Code Here

Examples of libsvm.svm_problem

    protected abstract int getLibsvmType();

    private static svm_problem toSvmProblem(Dataset dataset)
    {
        svm_problem problem = new svm_problem();
        List<Double> labels = dataset.getLabels();
        problem.l = labels.size();
        problem.y = new double[labels.size()];
        for (int i = 0; i < labels.size(); i++) {
            problem.y[i] = labels.get(i);
View Full Code Here

Examples of org.encog.mathutil.libsvm.svm_problem

   * @return The SVM problem.
   */
  public static svm_problem encode(final MLDataSet training,
      final int outputIndex) {
    try {
      final svm_problem result = new svm_problem();

      result.l = (int) training.getRecordCount();

      result.y = new double[result.l];
      result.x = new svm_node[result.l][training.getInputSize()];
View Full Code Here

Examples of org.encog.mathutil.libsvm.svm_problem

   * @return The SVM problem.
   */
  public static svm_problem encode(final MLDataSet training,
      final int outputIndex) {
    try {
      final svm_problem result = new svm_problem();

      result.l = (int) training.getRecordCount();

      result.y = new double[result.l];
      result.x = new svm_node[result.l][training.getInputSize()];
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.