Package cc.mallet.types

Examples of cc.mallet.types.FeatureSelection.nextSelectedIndex()


        // Respect the featureSelection
        FeatureSelection fs = featureSelections[i];
        nfeatures = fs.getBitSet ().cardinality ();
        int[] idxs = new int [nfeatures];
        int j = 0, thisIdx = -1;
        while ((thisIdx = fs.nextSelectedIndex (thisIdx + 1)) >= 0) {
          idxs[j++] = thisIdx;
        }
        newWeights[i] = new IndexedSparseVector (idxs, new double [nfeatures], nfeatures, nfeatures, false, false, false);
      }
      newWeights [i].plusEqualsSparse (parameters.weights [i]);
View Full Code Here


        // Respect the featureSelection
        FeatureSelection fs = featureSelections[i];
        nfeatures = fs.getBitSet ().cardinality ();
        int[] idxs = new int [nfeatures];
        int j = 0, thisIdx = -1;
        while ((thisIdx = fs.nextSelectedIndex (thisIdx + 1)) >= 0) {
          idxs[j++] = thisIdx;
        }
        newWeights[i] = new SparseVector (idxs, new double [nfeatures], nfeatures, nfeatures, false, false, false);
      }
      newWeights [i].plusEqualsSparse (parameters.weights [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.