• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java GeometricDistribution类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.apache.commons.math3.distribution.GeometricDistribution的典型用法代码示例。如果您正苦于以下问题:Java GeometricDistribution类的具体用法?Java GeometricDistribution怎么用?Java GeometricDistribution使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

GeometricDistribution类属于org.apache.commons.math3.distribution包,在下文中一共展示了GeometricDistribution类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getGeometric

点赞 3

import org.apache.commons.math3.distribution.GeometricDistribution; //导入依赖的package包/类
@Override
public RandomNumberDistribution<Integer> getGeometric(
		final RandomNumberStream rng, final Number p)
{
	final IntegerDistribution dist = new GeometricDistribution(
			RandomNumberStream.Util.asCommonsRandomGenerator(rng),
			p.doubleValue());
	return new RandomNumberDistribution<Integer>()
	{
		@Override
		public Integer draw()
		{
			return dist.sample();
		}
	};
}
 

开发者ID:krevelen,
项目名称:coala,
代码行数:17,
代码来源:RandomDistributionFactoryImpl.java

示例2: generateBackgroundItemsets

点赞 2

import org.apache.commons.math3.distribution.GeometricDistribution; //导入依赖的package包/类
/** Generate some disjoint itemsets as background noise */
public static HashMap<Itemset, Double> generateBackgroundItemsets(
		final int noItemsets, final double p, final int noItems,
		final double mu, final double sigma) {

	final HashMap<Itemset, Double> backgroundItemsets = Maps.newHashMap();

	final GeometricDistribution sizeDist = new GeometricDistribution(
			new Well19937c(1), p);
	final UniformIntegerDistribution itemDist = new UniformIntegerDistribution(
			20, 20 + noItems - 1);
	final LogNormalDistribution probDist = new LogNormalDistribution(
			new Well19937c(1), mu, sigma);

	while (backgroundItemsets.size() < noItemsets) {
		final int len = sizeDist.sample() + 1; // use shifted geometric
		final Itemset set = new Itemset();
		for (int i = 0; i < len; i++) {
			final int samp = itemDist.sample();
			set.add(samp);
		}
		final double num = probDist.sample();
		backgroundItemsets.put(set, num);
	}

	return backgroundItemsets;
}
 

开发者ID:mast-group,
项目名称:itemset-mining,
代码行数:28,
代码来源:TransactionGenerator.java

示例3: initialize

点赞 2

import org.apache.commons.math3.distribution.GeometricDistribution; //导入依赖的package包/类
public void initialize(Configuration conf) {
    ALPHA_ = conf.getDouble("ldbc.snb.datagen.generator.distribution.GeoDistribution.alpha", ALPHA_);
    geo_ = new GeometricDistribution(ALPHA_);
}
 

开发者ID:ldbc,
项目名称:ldbc_snb_datagen,
代码行数:5,
代码来源:GeoDistribution.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)