gpt4 book ai didi

org.apache.commons.math3.distribution.ZipfDistribution.getNumberOfElements()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 07:38:49 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.commons.math3.distribution.ZipfDistribution.getNumberOfElements()方法的一些代码示例,展示了ZipfDistribution.getNumberOfElements()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipfDistribution.getNumberOfElements()方法的具体详情如下:
包路径:org.apache.commons.math3.distribution.ZipfDistribution
类名称:ZipfDistribution
方法名:getNumberOfElements

ZipfDistribution.getNumberOfElements介绍

[英]Get the number of elements (e.g. corpus size) for the distribution.
[中]获取分布的元素数量(例如语料库大小)。

代码示例

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * {@inheritDoc}
 *
 * The upper bound of the support is the number of elements.
 *
 * @return upper bound of the support
 */
public int getSupportUpperBound() {
  return getNumberOfElements();
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Used by {@link #getNumericalMean()}.
 *
 * @return the mean of this distribution
 */
protected double calculateNumericalMean() {
  final int N = getNumberOfElements();
  final double s = getExponent();
  final double Hs1 = generalizedHarmonic(N, s - 1);
  final double Hs = generalizedHarmonic(N, s);
  return Hs1 / Hs;
}

代码示例来源:origin: org.apache.commons/commons-math3

/**
 * Used by {@link #getNumericalVariance()}.
 *
 * @return the variance of this distribution
 */
protected double calculateNumericalVariance() {
  final int N = getNumberOfElements();
  final double s = getExponent();
  final double Hs2 = generalizedHarmonic(N, s - 2);
  final double Hs1 = generalizedHarmonic(N, s - 1);
  final double Hs = generalizedHarmonic(N, s);
  return (Hs2 / Hs) - ((Hs1 * Hs1) / (Hs * Hs));
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * {@inheritDoc}
 *
 * The upper bound of the support is the number of elements.
 *
 * @return upper bound of the support
 */
public int getSupportUpperBound() {
  return getNumberOfElements();
}

代码示例来源:origin: geogebra/geogebra

/**
 * {@inheritDoc}
 *
 * The upper bound of the support is the number of elements.
 *
 * @return upper bound of the support
 */
public int getSupportUpperBound() {
  return getNumberOfElements();
}

代码示例来源:origin: geogebra/geogebra

/**
 * @param param
 *            number of elements
 * @param param2
 *            exponent
 * @return Zipf distribution
 */
ZipfDistribution getZipfDistribution(int param, double param2) {
  if (zipf == null || zipf.getNumberOfElements() != param
      || zipf.getExponent() != param2) {
    zipf = new ZipfDistribution(param, param2);
  }
  return zipf;
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Used by {@link #getNumericalMean()}.
 *
 * @return the mean of this distribution
 */
protected double calculateNumericalMean() {
  final int N = getNumberOfElements();
  final double s = getExponent();
  final double Hs1 = generalizedHarmonic(N, s - 1);
  final double Hs = generalizedHarmonic(N, s);
  return Hs1 / Hs;
}

代码示例来源:origin: geogebra/geogebra

/**
 * Used by {@link #getNumericalMean()}.
 *
 * @return the mean of this distribution
 */
protected double calculateNumericalMean() {
  final int N = getNumberOfElements();
  final double s = getExponent();
  final double Hs1 = generalizedHarmonic(N, s - 1);
  final double Hs = generalizedHarmonic(N, s);
  return Hs1 / Hs;
}

代码示例来源:origin: geogebra/geogebra

/**
 * Used by {@link #getNumericalVariance()}.
 *
 * @return the variance of this distribution
 */
protected double calculateNumericalVariance() {
  final int N = getNumberOfElements();
  final double s = getExponent();
  final double Hs2 = generalizedHarmonic(N, s - 2);
  final double Hs1 = generalizedHarmonic(N, s - 1);
  final double Hs = generalizedHarmonic(N, s);
  return (Hs2 / Hs) - ((Hs1 * Hs1) / (Hs * Hs));
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Used by {@link #getNumericalVariance()}.
 *
 * @return the variance of this distribution
 */
protected double calculateNumericalVariance() {
  final int N = getNumberOfElements();
  final double s = getExponent();
  final double Hs2 = generalizedHarmonic(N, s - 2);
  final double Hs1 = generalizedHarmonic(N, s - 1);
  final double Hs = generalizedHarmonic(N, s);
  return (Hs2 / Hs) - ((Hs1 * Hs1) / (Hs * Hs));
}

代码示例来源:origin: deeplearning4j/Arbiter

ZipfDistribution za = (ZipfDistribution) a;
  ZipfDistribution zb = (ZipfDistribution) b;
  return za.getNumberOfElements() == zb.getNumberOfElements() && za.getExponent() == zb.getNumberOfElements();
} else {
  throw new UnsupportedOperationException("Unknown or not supported IntegerDistribution: " + c);

代码示例来源:origin: org.deeplearning4j/arbiter-core

ZipfDistribution za = (ZipfDistribution) a;
  ZipfDistribution zb = (ZipfDistribution) b;
  return za.getNumberOfElements() == zb.getNumberOfElements() && za.getExponent() == zb.getNumberOfElements();
} else {
  throw new UnsupportedOperationException("Unknown or not supported IntegerDistribution: " + c);

代码示例来源:origin: org.deeplearning4j/arbiter-core

} else if (c == ZipfDistribution.class) {
  ZipfDistribution zd = (ZipfDistribution) d;
  j.writeNumberField("numElements", zd.getNumberOfElements());
  j.writeNumberField("exponent", zd.getExponent());
} else {

代码示例来源:origin: deeplearning4j/Arbiter

} else if (c == ZipfDistribution.class) {
  ZipfDistribution zd = (ZipfDistribution) d;
  j.writeNumberField("numElements", zd.getNumberOfElements());
  j.writeNumberField("exponent", zd.getExponent());
} else {

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com