本文整理了Java中org.apache.mahout.math.Vector.minValue()
方法的一些代码示例,展示了Vector.minValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.minValue()
方法的具体详情如下:
包路径:org.apache.mahout.math.Vector
类名称:Vector
方法名:minValue
暂无
代码示例来源:origin: apache/mahout
@Override
public double minValue() {
return delegate.minValue();
}
代码示例来源:origin: apache/mahout
assertEquals(dv1.getDistanceSquared(dv2), v1.getDistanceSquared(sv2), FUZZ);
assertEquals(dv1.minValue(), v1.minValue(), FUZZ);
assertEquals(dv1.minValueIndex(), v1.minValueIndex());
代码示例来源:origin: apache/mahout
@Override
public double minValue() {
return delegate.minValue();
}
代码示例来源:origin: org.apache.mahout/mahout-math
@Override
public double minValue() {
return delegate.minValue();
}
代码示例来源:origin: cloudera/mahout
@Override
public double minValue() {
return delegate.minValue();
}
代码示例来源:origin: org.apache.mahout/mahout-math
@Override
public double minValue() {
return delegate.minValue();
}
代码示例来源:origin: apache/mahout
vec1.setQuick(2, 2);
double max = vec1.minValue();
assertEquals(1.0, max, 0.0);
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
@Override
public double apply(Vector column) {
return column.minValue();
}
}).minValue();
代码示例来源:origin: cheng-li/pyramid
/**
* always use global min and max
* @param vector
* @param inputsEachClass
* @return
*/
public List<EmpiricalCDF> generateCDFs(Vector vector, List<List<Double>> inputsEachClass){
double min = vector.minValue();
double max = vector.maxValue();
return inputsEachClass.stream().map(list -> new EmpiricalCDF(list,min,max,numBins)).collect(Collectors.toList());
}
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
public void validate() {
Preconditions.checkState(alphaI > 0, "alphaI has to be greater than 0!");
Preconditions.checkArgument(numFeatures > 0, "the vocab count has to be greater than 0!");
Preconditions.checkArgument(totalWeightSum > 0, "the totalWeightSum has to be greater than 0!");
Preconditions.checkNotNull(weightsPerLabel, "the number of labels has to be defined!");
Preconditions.checkArgument(weightsPerLabel.getNumNondefaultElements() > 0,
"the number of labels has to be greater than 0!");
Preconditions.checkNotNull(weightsPerFeature, "the feature sums have to be defined");
Preconditions.checkArgument(weightsPerFeature.getNumNondefaultElements() > 0,
"the feature sums have to be greater than 0!");
if (isComplementary){
Preconditions.checkArgument(perlabelThetaNormalizer != null, "the theta normalizers have to be defined");
Preconditions.checkArgument(perlabelThetaNormalizer.getNumNondefaultElements() > 0,
"the number of theta normalizers has to be greater than 0!");
Preconditions.checkArgument(Math.signum(perlabelThetaNormalizer.minValue())
== Math.signum(perlabelThetaNormalizer.maxValue()),
"Theta normalizers do not all have the same sign");
Preconditions.checkArgument(perlabelThetaNormalizer.getNumNonZeroElements()
== perlabelThetaNormalizer.size(),
"Theta normalizers can not have zero value.");
}
}
}
代码示例来源:origin: org.apache.mahout/mahout-mr
public void validate() {
Preconditions.checkState(alphaI > 0, "alphaI has to be greater than 0!");
Preconditions.checkArgument(numFeatures > 0, "the vocab count has to be greater than 0!");
Preconditions.checkArgument(totalWeightSum > 0, "the totalWeightSum has to be greater than 0!");
Preconditions.checkNotNull(weightsPerLabel, "the number of labels has to be defined!");
Preconditions.checkArgument(weightsPerLabel.getNumNondefaultElements() > 0,
"the number of labels has to be greater than 0!");
Preconditions.checkNotNull(weightsPerFeature, "the feature sums have to be defined");
Preconditions.checkArgument(weightsPerFeature.getNumNondefaultElements() > 0,
"the feature sums have to be greater than 0!");
if (isComplementary){
Preconditions.checkArgument(perlabelThetaNormalizer != null, "the theta normalizers have to be defined");
Preconditions.checkArgument(perlabelThetaNormalizer.getNumNondefaultElements() > 0,
"the number of theta normalizers has to be greater than 0!");
Preconditions.checkArgument(Math.signum(perlabelThetaNormalizer.minValue())
== Math.signum(perlabelThetaNormalizer.maxValue()),
"Theta normalizers do not all have the same sign");
Preconditions.checkArgument(perlabelThetaNormalizer.getNumNonZeroElements()
== perlabelThetaNormalizer.size(),
"Theta normalizers can not have zero value.");
}
}
}
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
@Override
public double apply(Vector f) {
// Return the sum of three discrepancy measures.
return Math.abs(f.minValue()) + Math.abs(f.maxValue() - 6) + Math.abs(f.norm(1) - 6);
}
});
代码示例来源:origin: org.apache.mahout/mahout-core
if (samples.minValue() >= 1) {
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
if (samples.minValue() >= 1) {
代码示例来源:origin: org.apache.mahout/mahout-mr
if (samples.minValue() >= 1) {
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
private void normalize(Matrix source, final double range) {
final double max = source.aggregateColumns(new VectorFunction() {
@Override
public double apply(Vector column) {
return column.maxValue();
}
}).maxValue();
final double min = source.aggregateColumns(new VectorFunction() {
@Override
public double apply(Vector column) {
return column.minValue();
}
}).minValue();
source.assign(new DoubleFunction() {
@Override
public double apply(double value) {
return (value - min) * range / (max - min);
}
});
}
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
Vector v1 = new DenseVector(20);
enc.addToVector((byte[]) null, -123, v1);
assertEquals(-123, v1.minValue(), 0);
assertEquals(0, v1.maxValue(), 0);
assertEquals(123, v1.norm(1), 0);
enc.addToVector((byte[]) null, 123, v1);
assertEquals(123, v1.maxValue(), 0);
assertEquals(0, v1.minValue(), 0);
assertEquals(123, v1.norm(1), 0);
代码示例来源:origin: org.apache.mahout/mahout-mrlegacy
Vector v1 = new DenseVector(20);
enc.addToVector("-123", v1);
assertEquals(-123, v1.minValue(), 0);
assertEquals(0, v1.maxValue(), 0);
assertEquals(123, v1.norm(1), 0);
enc.addToVector("123", v1);
assertEquals(123, v1.maxValue(), 0);
assertEquals(0, v1.minValue(), 0);
assertEquals(123, v1.norm(1), 0);
代码示例来源:origin: cloudera/mahout
vec1.setQuick(2, 2);
double max = vec1.minValue();
assertEquals(1.0, max, 0.0);
内容来源于网络,如有侵权,请联系作者删除!