本文整理汇总了Java中org.apache.mahout.math.jet.random.Gamma类的典型用法代码示例。如果您正苦于以下问题:Java Gamma类的具体用法?Java Gamma怎么用?Java Gamma使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Gamma类属于org.apache.mahout.math.jet.random包,在下文中一共展示了Gamma类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGamma
import org.apache.mahout.math.jet.random.Gamma; //导入依赖的package包/类
@Test
public void testGamma() {
// this Gamma distribution is very heavily skewed. The 0.1%-ile is 6.07e-30 while
// the median is 0.006 and the 99.9th %-ile is 33.6 while the mean is 1.
// this severe skew means that we have to have positional accuracy that
// varies by over 11 orders of magnitude.
Random gen = RandomUtils.getRandom();
for (int i = 0; i < repeats(); i++) {
runTest(new Gamma(0.1, 0.1, gen), 100,
// new double[]{6.0730483624079e-30, 6.0730483624079e-20, 6.0730483627432e-10, 5.9339110446023e-03,
// 2.6615455373884e+00, 1.5884778179295e+01, 3.3636770117188e+01},
new double[]{0.001, 0.01, 0.1, 0.5, 0.9, 0.99, 0.999},
"gamma", true, gen);
}
}
示例2: compareToQDigest
import org.apache.mahout.math.jet.random.Gamma; //导入依赖的package包/类
@Test
public void compareToQDigest() {
Random rand = RandomUtils.getRandom();
for (int i = 0; i < repeats(); i++) {
compare(new Gamma(0.1, 0.1, rand), "gamma", 1L << 48, rand);
compare(new Uniform(0, 1, rand), "uniform", 1L << 48, rand);
}
}
示例3: testGamma
import org.apache.mahout.math.jet.random.Gamma; //导入依赖的package包/类
@Test
public void testGamma() {
// this Gamma distribution is very heavily skewed. The 0.1%-ile is 6.07e-30 while
// the median is 0.006 and the 99.9th %-ile is 33.6 while the mean is 1.
// this severe skew means that we have to have positional accuracy that
// varies by over 11 orders of magnitude.
Random gen = getRandom();
for (int i = 0; i < repeats(); i++) {
runTest(factory(), new Gamma(0.1, 0.1, gen), 100,
// new double[]{6.0730483624079e-30, 6.0730483624079e-20, 6.0730483627432e-10, 5.9339110446023e-03,
// 2.6615455373884e+00, 1.5884778179295e+01, 3.3636770117188e+01},
new double[]{0.001, 0.01, 0.1, 0.5, 0.9, 0.99, 0.999},
"gamma", true);
}
}
示例4: compareToQDigest
import org.apache.mahout.math.jet.random.Gamma; //导入依赖的package包/类
@Test
public void compareToQDigest() throws FileNotFoundException {
Random rand = getRandom();
try (PrintWriter out = new PrintWriter(new FileOutputStream("qd-tree-comparison.csv"))) {
for (int i = 0; i < repeats(); i++) {
compareQD(out, new Gamma(0.1, 0.1, rand), "gamma", 1L << 48);
compareQD(out, new Uniform(0, 1, rand), "uniform", 1L << 48);
}
}
}
示例5: compareToStreamingQuantile
import org.apache.mahout.math.jet.random.Gamma; //导入依赖的package包/类
@Test
public void compareToStreamingQuantile() throws FileNotFoundException {
Random rand = getRandom();
try (PrintWriter out = new PrintWriter(new FileOutputStream("sq-tree-comparison.csv"))) {
for (int i = 0; i < repeats(); i++) {
compareSQ(out, new Gamma(0.1, 0.1, rand), "gamma", 1L << 48);
compareSQ(out, new Uniform(0, 1, rand), "uniform", 1L << 48);
}
}
}
示例6: Changer
import org.apache.mahout.math.jet.random.Gamma; //导入依赖的package包/类
public Changer(@JsonProperty("values") List<FieldSampler> fields) {
this.fields = fields;
fieldNames = Lists.newArrayList();
for (FieldSampler field : fields) {
fieldNames.add(field.getName());
}
x = new Gamma(1, 1, gen);
y = new Gamma(3, 1, gen);
}
示例7: create
import org.apache.mahout.math.jet.random.Gamma; //导入依赖的package包/类
@Override
public AbstractContinousDistribution create(Random gen) {
return new Gamma(0.1, 0.1, gen);
}