Examples of sparseWeights()


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

        smo.setToleranceParameter(m_smoTParameter);
        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];
        }
View Full Code Here

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

        Classifier classifier = wekaModel.getClassifier();
        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];
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.