Package org.apache.mahout.ga.watchmaker.cd.hadoop.DatasetSplit

Examples of org.apache.mahout.ga.watchmaker.cd.hadoop.DatasetSplit.RndLineRecordReader


      DatasetSplit split = new DatasetSplit(rng.getSeed(), threshold);

      // read the training set
      split.storeJobParameters(conf);
      long datasetSize = 100;
      RndLineRecordReader rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.next(key, value)) {
        assertTrue("duplicate line index", dataset.add(key.get()));
      }

      // read the testing set
      split.setTraining(false);
      split.storeJobParameters(conf);
      rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.next(key, value)) {
        assertTrue("duplicate line index", dataset.add(key.get()));
      }

      assertEquals("missing datas", datasetSize, dataset.size());
    }
View Full Code Here


      DatasetSplit split = new DatasetSplit(rng.getSeed(), threshold);

      // read the training set
      split.storeJobParameters(conf);
      long datasetSize = 100;
      RndLineRecordReader rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.nextKeyValue()) {
        assertTrue("duplicate line index", dataset.add(rndReader.getCurrentKey().get()));
      }

      // read the testing set
      split.setTraining(false);
      split.storeJobParameters(conf);
      rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.nextKeyValue()) {
        assertTrue("duplicate line index", dataset.add(rndReader.getCurrentKey().get()));
      }

      assertEquals("missing datas", datasetSize, dataset.size());
    }
  }
View Full Code Here

      MersenneTwisterRNG rng = new MersenneTwisterRNG();
      byte[] seed = rng.getSeed();
      double threshold = rng.nextDouble();

      JobConf conf = new JobConf();
      RndLineRecordReader rndReader;
      Set<Long> dataset = new HashSet<Long>();
      LongWritable key = new LongWritable();
      Text value = new Text();
     
      DatasetSplit split = new DatasetSplit(seed, threshold);

      // read the training set
      split.storeJobParameters(conf);
      rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.next(key, value)) {
        assertTrue("duplicate line index", dataset.add(key.get()));
      }

      // read the testing set
      split.setTraining(false);
      split.storeJobParameters(conf);
      rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.next(key, value)) {
        assertTrue("duplicate line index", dataset.add(key.get()));
      }

      assertEquals("missing datas", datasetSize, dataset.size());
    }
View Full Code Here

      DatasetSplit split = new DatasetSplit(seed, threshold);

      // read the training set
      split.storeJobParameters(conf);
      long datasetSize = 100;
      RndLineRecordReader rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.next(key, value)) {
        assertTrue("duplicate line index", dataset.add(key.get()));
      }

      // read the testing set
      split.setTraining(false);
      split.storeJobParameters(conf);
      rndReader = new RndLineRecordReader(new MockReader(datasetSize), conf);
      while (rndReader.next(key, value)) {
        assertTrue("duplicate line index", dataset.add(key.get()));
      }

      assertEquals("missing datas", datasetSize, dataset.size());
    }
View Full Code Here

TOP

Related Classes of org.apache.mahout.ga.watchmaker.cd.hadoop.DatasetSplit.RndLineRecordReader

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.