Package cc.mallet.pipe.iterator

Examples of cc.mallet.pipe.iterator.RandomTokenSequenceIterator


    this (new SerialPipes (new Pipe[]  {
        new TokenSequence2FeatureSequence (),
        new FeatureSequence2FeatureVector (),
        new Target2Label()}));
    //classCentroidDistribution.print();
    Iterator<Instance> iter = new RandomTokenSequenceIterator (
        r, classCentroidDistribution,
        classCentroidAverageAlphaMean, classCentroidAverageAlphaVariance,
        featureVectorSizePoissonLambda, classInstanceCountPoissonLambda,
        classNames);
    this.addThruPipe (iter);
View Full Code Here


      for (int i = 0; i < trainers.length; i++)
        System.out.println (classifiers[i].getClass().getName()
                            + ": " + new Trial (classifiers[i], training).getAccuracy());

      InstanceList testing = new InstanceList (training.getPipe ());
      Iterator<Instance> iter = new RandomTokenSequenceIterator (
        r,  new Dirichlet (fd, 2.0),
        30, 0,
        10, 50,
        classNames);
      testing.addThruPipe (iter);
View Full Code Here

    Alphabet fd = dictOfSize (3);
    String[] classNames = new String[] {"class0", "class1", "class2"};

    Randoms r = new Randoms (1);
    Iterator<Instance> iter = new RandomTokenSequenceIterator (r,  new Dirichlet(fd, 2.0),
          30, 0, 10, 200, classNames);
    training.addThruPipe (iter);

    InstanceList testing = new InstanceList (training.getPipe ());
    testing.addThruPipe (new RandomTokenSequenceIterator (r,  new Dirichlet(fd, 2.0),
          30, 0, 10, 200, classNames));

    System.out.println ("Training set size = "+training.size());
    System.out.println ("Testing set size = "+testing.size());
View Full Code Here

TOP

Related Classes of cc.mallet.pipe.iterator.RandomTokenSequenceIterator

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.