Package org.data2semantics.proppred.learners.liblinear

Examples of org.data2semantics.proppred.learners.liblinear.LibLINEARModel


        targetSplit = LibLINEAR.splitTestTarget(target, linearParms.getSplitFraction());
       
        // If we deal with on RDFWLSubTree, then we show the most used features, based on the featuremap created
        if (kernel instanceof RDFWLSubTreeKernel) {
          RDFWLSubTreeKernel k = (RDFWLSubTreeKernel) kernel;
          LibLINEARModel model = LibLINEAR.trainLinearModel(fv, target, linearParms);
          LibLINEARModel.WeightIndexPair[][] fw = model.getFeatureWeights();
         
          Map<String, String> lm = k.getInverseLabelMap();
         
          System.out.println("Map size: " + lm.size() + " fw length: " + fw[0].length + " fv max index: " + fv[0].getLastIndex());
         
View Full Code Here


    }
    linParms.setWeightLabels(wLabels);
    linParms.setWeights(weights);
   
    // Train model on the first 100 instances.
    LibLINEARModel model = LibLINEAR.trainLinearModel(Arrays.copyOfRange(featureVectors, 0, 100), EvaluationUtils.target2Doubles(target.subList(0, 100)), linParms);

    // Test on the rest of the data
    Prediction[] predictions = LibLINEAR.testLinearModel(model, Arrays.copyOfRange(featureVectors, 100, featureVectors.length));
   
    // Print out the predictions and compute the accuracy on the test set.
View Full Code Here

TOP

Related Classes of org.data2semantics.proppred.learners.liblinear.LibLINEARModel

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.