Package org.apache.mahout.math.stats

Examples of org.apache.mahout.math.stats.Sampler.sample()


    Preconditions.checkArgument(topicDistribution.size() == samplers.length,
        "topicDistribution must have same cardinality as the sampling model");
    int[] samples = new int[numSamples];
    Sampler topicSampler = new Sampler(random, topicDistribution);
    for(int i = 0; i < numSamples; i++) {
      samples[i] = samplers[topicSampler.sample()].sample();
    }
    return samples;
  }
}
View Full Code Here


          Preconditions.checkArgument(topicDistribution.size() == samplers.length,
                  "topicDistribution must have same cardinality as the sampling model");
          int[] samples = new int[numSamples];
          Sampler topicSampler = new Sampler(random, topicDistribution);
          for (int i = 0; i < numSamples; i++) {
              samples[i] = samplers[topicSampler.sample()].sample();
          }
          return samples;
      }
  }
}
View Full Code Here

          Preconditions.checkArgument(topicDistribution.size() == samplers.length,
                  "topicDistribution must have same cardinality as the sampling model");
          int[] samples = new int[numSamples];
          Sampler topicSampler = new Sampler(random, topicDistribution);
          for (int i = 0; i < numSamples; i++) {
              samples[i] = samplers[topicSampler.sample()].sample();
          }
          return samples;
      }
  }
}
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.