本文整理了Java中org.apache.mahout.math.jet.random.Normal.setState()
方法的一些代码示例,展示了Normal.setState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Normal.setState()
方法的具体详情如下:
包路径:org.apache.mahout.math.jet.random.Normal
类名称:Normal
方法名:setState
[英]Sets the mean and variance.
[中]设置均值和方差。
代码示例来源:origin: apache/mahout
/**
* @param mean The mean of the resulting distribution.
* @param standardDeviation The standard deviation of the distribution.
* @param randomGenerator The random number generator to use. This can be null if you don't
* need to generate any numbers.
*/
public Normal(double mean, double standardDeviation, Random randomGenerator) {
setRandomGenerator(randomGenerator);
setState(mean, standardDeviation);
}
代码示例来源:origin: apache/mahout
@Test
public void consistency() {
Random gen = RandomUtils.getRandom();
double offset = 0;
double scale = 1;
Normal dist = new Normal(offset, scale, RandomUtils.getRandom());
for (int k = 0; k < 20; k++) {
dist.setState(offset, scale);
DistributionChecks.checkDistribution(dist, breaks, offset, scale, 10000);
offset = gen.nextGaussian();
scale = Math.exp(3 * gen.nextGaussian());
}
}
代码示例来源:origin: apache/mahout
@Test
public void testSetState() throws Exception {
Normal dist = new Normal(0, 1, RandomUtils.getRandom());
dist.setState(1.3, 5.9);
DistributionChecks.checkDistribution(dist, breaks, 1.3, 5.9, 10000);
}
代码示例来源:origin: org.apache.mahout/mahout-math
/**
* @param mean The mean of the resulting distribution.
* @param standardDeviation The standard deviation of the distribution.
* @param randomGenerator The random number generator to use. This can be null if you don't
* need to generate any numbers.
*/
public Normal(double mean, double standardDeviation, Random randomGenerator) {
setRandomGenerator(randomGenerator);
setState(mean, standardDeviation);
}
代码示例来源:origin: cloudera/mahout
/**
* @param mean The mean of the resulting distribution.
* @param standardDeviation The standard deviation of the distribution.
* @param randomGenerator The random number generator to use. This can be null if you don't
* need to generate any numbers.
*/
public Normal(double mean, double standardDeviation, Random randomGenerator) {
setRandomGenerator(randomGenerator);
setState(mean, standardDeviation);
}
代码示例来源:origin: cloudera/mahout
@Test
public void consistency() throws Exception {
Random gen = RandomUtils.getRandom();
double offset = 0;
double scale = 1;
Normal dist = new Normal(offset, scale, RandomUtils.getRandom());
for (int k = 0; k < 20; k++) {
dist.setState(offset, scale);
DistributionChecks.checkDistribution(dist, breaks, offset, scale, 10000);
offset = gen.nextGaussian();
scale = Math.exp(3 * gen.nextGaussian());
}
}
代码示例来源:origin: cloudera/mahout
@Test
public void testSetState() throws Exception {
Normal dist = new Normal(0, 1, RandomUtils.getRandom());
dist.setState(1.3, 5.9);
DistributionChecks.checkDistribution(dist, breaks, 1.3, 5.9, 10000);
}
内容来源于网络,如有侵权,请联系作者删除!