Examples of loadThruStagePipes()


Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

    InstanceSet instset = new InstanceSet(pp2,af);



    //读入数据,并进行数据处理
    instset.loadThruStagePipes(reader);

    /**
     * 建立分类器
     */   
    OnlineTrainer trainer = new OnlineTrainer(af,100);
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

      SeriesPipes pipe = new SeriesPipes(new Pipe[]{lpipe,fpipe});



      InstanceSet instset = new InstanceSet(pipe,factory);
      instset.loadThruStagePipes(new SimpleFileReader(trainFile," ",true,Type.LabelData));
      Generator gen = new SFGenerator();
      ZeroOneLoss l = new ZeroOneLoss();
      Inferencer ms = new LinearMax(gen, factory.getLabelSize());
      Update update = new LinearMaxPAUpdate(l);
      OnlineTrainer trainer = new OnlineTrainer(ms, update,l, factory.getFeatureSize(), 50,0.005f);
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

    SeriesPipes pp = new SeriesPipes(new Pipe[]{removepp,segpp,s2spp,targetpp,sparsepp});

    System.out.print("\nReading data......\n");
    InstanceSet instset = new InstanceSet(pp,af)
    Reader reader = new MyDocumentReader(trainDataPath,"gbk");
    instset.loadThruStagePipes(reader);
    System.out.print("..Reading data complete\n");
   
    //将数据集分为训练是和测试集
    System.out.print("Sspliting....");
    float percent = 0.8f;
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

    System.out.print("读入训练数据 ...");
    InstanceSet trainSet = new InstanceSet(pipe, factory);

    // 训练集
    trainSet.loadThruStagePipes(new SequenceReader(train, true, "utf8"));
    System.out.println("训练样本个数 " + trainSet.size());
    System.out.println("标签个数: " + labels.size()); //
    System.out.println("特征个数" + features.size());

    // 冻结特征集
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

   
    //用不同的Reader读取相应格式的文件
    Reader reader = new FileReader(trainDataPath,"UTF-8",".data");
   
    //读入数据,并进行数据处理
    instset.loadThruStagePipes(reader);
       
    float percent = 0.8f;
   
    //将数据集分为训练是和测试集
    InstanceSet[] splitsets = instset.split(percent);
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

    SeriesPipes pp = new SeriesPipes(new Pipe[]{ngrampp,targetpp,sparsepp});

    System.out.print("\nReading data......\n");
    InstanceSet instset = new InstanceSet(pp,af)
    Reader reader = new MyDocumentReader(trainDataPath,"gbk");
    instset.loadThruStagePipes(reader);
    System.out.print("..Reading data complete\n");
   
    //将数据集分为训练是和测试集
    System.out.print("Sspliting....");
    float percent = 0.9f;
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

    LabelAlphabet labels = factory.DefaultLabelAlphabet();
    IFeatureAlphabet features = factory.DefaultFeatureAlphabet();

    // 训练集
    trainSet.loadThruStagePipes(new SequenceReader(train,true, "utf8"));

    long endTime = System.currentTimeMillis();
    System.out.println(" done!");
    System.out
    .println("Time escape: " + (endTime - beginTime) / 1000 + "s");
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

      }

      // 测试集
      testSet = new InstanceSet(tpipe);

      testSet.loadThruStagePipes(new SequenceReader(testfile, true, "utf8"));
      System.out.println("Test Number: " + testSet.size()); // 样本个数
    }

    /**
     *
 
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

    Pipe pipe = createProcessor(true);

    // 测试集
    InstanceSet testSet = new InstanceSet(pipe);

    testSet.loadThruStagePipes(new SequenceReader(testfile, true, "utf8"));
    System.out.println("Test Number: " + testSet.size()); // 样本个数

    long featuretime = System.currentTimeMillis();

    boolean acc = true;
View Full Code Here

Examples of org.fnlp.ml.types.InstanceSet.loadThruStagePipes()

    //读入数据,并进行数据处理
    trainset.loadThruStagePipes(reader);
   
    reader = new DocumentReader(testDataPath);
     
    testset.loadThruStagePipes(reader);
   
   
    /**
     * 建立分类器
     */   
 
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.