Class PrimitiveVector
java.lang.Object
smile.data.vector.AbstractVector
smile.data.vector.PrimitiveVector
- All Implemented Interfaces:
Serializable, ValueVector
- Direct Known Subclasses:
BooleanVector, ByteVector, CharVector, DoubleVector, FloatVector, IntVector, LongVector, ShortVector
Abstract base class implementation of ValueVector interface.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of null/missing values in this vector.booleanReturns true if the values of vector may be null.booleanisNullAt(int i) Returns true if the value at the given index is null/missing.doublemax()Returns the maximal value.doublemean()Returns the mean.doublemedian()Returns the median.doublemin()Returns the minimal value.doubleq1()Returns the 25% quantile.doubleq3()Returns the 75% quantile.doublestdev()Returns the standard deviation.doublesum()Returns the sum of values.doublevar()Returns the variance of values.Methods inherited from class AbstractVector
field, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ValueVector
anyNull, apply, apply, doubleStream, dtype, eq, ge, get, get, get, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getScale, getShort, getString, gt, intStream, isin, isin, isNull, le, longStream, lt, measure, name, ne, set, size, slice, slice, stream, toDoubleArray, toIntArray, toLongArray, toStringArray, toStringArray, update, withName
-
Constructor Details
-
PrimitiveVector
Constructor.- Parameters:
field- The struct field of the vector.
-
-
Method Details
-
mean
public double mean()Returns the mean.- Returns:
- the mean.
-
stdev
public double stdev()Returns the standard deviation.- Returns:
- the standard deviation.
-
min
public double min()Returns the minimal value.- Returns:
- the minimal value.
-
max
public double max()Returns the maximal value.- Returns:
- the maximal value.
-
median
public double median()Returns the median.- Returns:
- the median.
-
q1
public double q1()Returns the 25% quantile.- Returns:
- the 25% quantile.
-
q3
public double q3()Returns the 75% quantile.- Returns:
- the 75% quantile.
-
sum
public double sum()Returns the sum of values.- Returns:
- the sum of values.
-
var
public double var()Returns the variance of values.- Returns:
- the variance of values.
-
isNullable
public boolean isNullable()Description copied from interface:ValueVectorReturns true if the values of vector may be null.- Returns:
- true if the values of vector may be null.
-
isNullAt
public boolean isNullAt(int i) Description copied from interface:ValueVectorReturns true if the value at the given index is null/missing.- Parameters:
i- the index.- Returns:
- true if the value at the given index is null/missing.
-
getNullCount
public int getNullCount()Description copied from interface:ValueVectorReturns the number of null/missing values in this vector.- Returns:
- the number of null/missing values in this vector.
-