Package weka.classifiers.functions

Examples of weka.classifiers.functions.SPegasos


    public Evaluation crossValidate(ArrayList<LinkedHashMap<Integer, Double>> trainingSamples, ArrayList<Integer> labels, int numFolds, int numFeats) {
        Instances trainingSet = fillDataSet(trainingSamples, labels, numFeats);
        Instances initial = trainingSet.stringFreeStructure();
        Evaluation eTest = null;
        SPegasos cModel = new SPegasos();
        try {
            cModel.buildClassifier(initial);
            for (int i = 0; i < trainingSet.numInstances(); i++) {
                cModel.updateClassifier(trainingSet.instance(i));
            }
            eTest = new Evaluation(trainingSet);
            if (numFolds > trainingSet.numInstances()) {
                numFolds = trainingSet.numInstances();
            }
View Full Code Here

TOP

Related Classes of weka.classifiers.functions.SPegasos

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.