Package com.github.pmerienne.trident.ml.stats

Examples of com.github.pmerienne.trident.ml.stats.StreamStatistics


          // Transform trident tupl to instance
          .each(new Fields("x0", "x1"), new InstanceCreator(false), new Fields("instance"))

          // Update original stream statistics
          .partitionPersist(new MemoryMapState.Factory(), new Fields("instance"), new StreamStatisticsUpdater("originalStreamStats", new StreamStatistics()),
              new Fields("instance", "originalStreamStats")).newValuesStream()

          // Standardized stream using original stream statistics
          .each(new Fields("instance", "originalStreamStats"), new StandardScaler(), new Fields("scaledInstance"))

          // Update scaled stream statistics
          .partitionPersist(new MemoryMapState.Factory(), new Fields("scaledInstance"), new StreamStatisticsUpdater("scaledStreamStats", new StreamStatistics()));

      toppology.newDRPCStream("queryStats", localDRPC)
          // Convert DRPC args to stat query
          .each(new Fields("args"), new TuplifyArgs(), new Fields("featureIndex", "queryType"))
View Full Code Here


  private static final long serialVersionUID = 1740717206768121351L;

  @Override
  public void execute(TridentTuple tuple, TridentCollector collector) {
    Instance<?> instance = (Instance<?>) tuple.get(0);
    StreamStatistics streamStatistics = (StreamStatistics) tuple.get(1);

    Instance<?> standardizedInstance = this.standardize(instance, streamStatistics);
    collector.emit(new Values(standardizedInstance));
  }
View Full Code Here

TOP

Related Classes of com.github.pmerienne.trident.ml.stats.StreamStatistics

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.