Package cc.mallet.types

Examples of cc.mallet.types.FeatureSelection


        String wn = (String)outputAlphabet.lookupObject(i) + "->" + (String)outputAlphabet.lookupObject(j);
        weightNames[j][1] = wn;
        int wi = getWeightsIndex (wn);
        // A new empty FeatureSelection won't allow any features here, so we only
        // get the default feature for transitions
        featureSelections[wi] = new FeatureSelection(trainingSet.getDataAlphabet());
      }
      addState ((String)outputAlphabet.lookupObject(i), 0.0, 0.0,
          destinationNames, destinationNames, weightNames);
    }
  }
View Full Code Here


                if (defaults != null && defaults[i]) {
                  int wi = getWeightsIndex (weightNames[nt][i]);
                  // Using empty feature selection gives us only the
                  // default features
                  featureSelections[wi] =
                    new FeatureSelection(trainingSet.getDataAlphabet());
                }
              }
              nt++;
            }
          }
View Full Code Here

        nfeatures = max;
        newWeights [i] = new SparseVector (null, new double [max],
            max, max, false, false, false);
      } else {
        // 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

Related Classes of cc.mallet.types.FeatureSelection

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.