Package de.bwaldvogel.liblinear

Examples of de.bwaldvogel.liblinear.Problem


  private static Problem createProblemTrainSplit(Problem problem, float splitFrac) {
    int foldStart = 0;
    int foldEnd   = Math.round(((float) problem.l) * splitFrac);

    Problem prob = new Problem();
    prob.y = Arrays.copyOfRange(problem.y, foldStart, foldEnd);
    prob.x = Arrays.copyOfRange(problem.x, foldStart, foldEnd);
    prob.l = foldEnd;
    prob.n = problem.n;

View Full Code Here


  private static Problem createProblemTestSplit(Problem problem, float splitFrac) {
    int foldStart = Math.round(((float) problem.l) * splitFrac);
    int foldEnd   = problem.l;

    Problem prob = new Problem();
    prob.y = Arrays.copyOfRange(problem.y, foldStart, foldEnd);
    prob.x = Arrays.copyOfRange(problem.x, foldStart, foldEnd);
    prob.l = prob.y.length;
    prob.n = problem.n;

View Full Code Here

  private static Problem createProblemTrainFold(Problem problem, int numberOfFolds, int fold) {
    int foldStart = Math.round((problem.x.length / ((float) numberOfFolds)) * ((float) fold - 1));
    int foldEnd   = Math.round((problem.x.length / ((float) numberOfFolds)) * ((float) fold));
    int foldLength = (foldEnd-foldStart);

    Problem prob = new Problem();
    prob.y = new double[problem.x.length - foldLength];
    prob.x = new FeatureNode[problem.x.length - foldLength][];
    prob.l = problem.x.length - foldLength;
    prob.n = problem.n;

View Full Code Here

     */
    protected Problem getProblem(FeatureNode[][] vx, int[] vy, int max_index) {

        if (vx.length != vy.length) throw new IllegalArgumentException("vx and vy must have same size");

        Problem problem = new Problem();

        problem.l = vy.length;
        problem.n = max_index;
        problem.bias = getBias();
        problem.x = vx;
View Full Code Here

TOP

Related Classes of de.bwaldvogel.liblinear.Problem

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.