Examples of sparseIndices()


Examples of weka.classifiers.functions.SMO.sparseIndices()

        smo.setC(m_smoCParameter);
        smo.buildClassifier(trainCopy);
                               
        // Find the attribute with maximum weight^2
        double[] weightsSparse = smo.sparseWeights()[0][1];
        int[] indicesSparse = smo.sparseIndices()[0][1];
        double[] weights = new double[trainCopy.numAttributes()];
        for (int j = 0; j < weightsSparse.length; j++) {
          weights[indicesSparse[j]] = weightsSparse[j] * weightsSparse[j];
        }
        weights[trainCopy.classIndex()] = Double.MAX_VALUE;
View Full Code Here

Examples of weka.classifiers.functions.SMO.sparseIndices()

        Instances dataFormat = trainingExamples.getInstances();

        SMO smo = getSMO(classifier);

        double[] sparseWeights = smo.sparseWeights()[0][1];
        int[] sparseIndices = smo.sparseIndices()[0][1];

        Map<String, Double> weights = new HashMap<String, Double>();
        for (int i = 0; i < sparseWeights.length; i++) {
            int index = sparseIndices[i];
            double weight = sparseWeights[i];
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.