org.apache.mahout.math
Class Centroid
java.lang.Object
org.apache.mahout.math.DelegatingVector
org.apache.mahout.math.WeightedVector
org.apache.mahout.math.Centroid
- All Implemented Interfaces:
- Cloneable, Vector
public class Centroid
- extends WeightedVector
A centroid is a weighted vector. We have it delegate to the vector itself for lots of operations
to make it easy to use vector search classes and such.
Methods inherited from class org.apache.mahout.math.DelegatingVector |
aggregate, aggregate, all, asFormatString, assign, assign, assign, assign, assign, assign, cross, divide, dot, equals, get, getDistanceSquared, getElement, getIteratorAdvanceCost, getLengthSquared, getLookupCost, getNumNondefaultElements, getNumNonZeroElements, getQuick, getVector, hashCode, incrementQuick, invalidateCachedLength, isAddConstantTime, isDense, isSequentialAccess, logNormalize, logNormalize, maxValue, maxValueIndex, mergeUpdates, minus, minValue, minValueIndex, nonZeroes, norm, normalize, normalize, plus, plus, set, setQuick, size, times, times, viewPart, zSum |
Centroid
public Centroid(WeightedVector original)
Centroid
public Centroid(int key,
Vector initialValue)
Centroid
public Centroid(int key,
Vector initialValue,
double weight)
create
public static Centroid create(int key,
Vector initialValue)
update
public void update(Vector v)
update
public void update(Vector other,
double wy)
like
public Centroid like()
- Description copied from interface:
Vector
- Return an empty vector of the same underlying class as the receiver
- Specified by:
like
in interface Vector
- Overrides:
like
in class WeightedVector
- Returns:
- a Vector
getKey
@Deprecated
public int getKey()
- Deprecated.
- Gets the index of this centroid. Use getIndex instead to maintain standard names.
addWeight
public void addWeight(double newWeight)
toString
public String toString()
- Overrides:
toString
in class WeightedVector
clone
public Centroid clone()
- Description copied from interface:
Vector
- Return a copy of the recipient
- Specified by:
clone
in interface Vector
- Overrides:
clone
in class WeightedVector
- Returns:
- a new Vector
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.