/** * Computes the unbiased variance (second central moment, * squared standard deviation) of a dataset. Computes the mean first, * then computes the variance. If you already have the mean, then use the * two-argument computeVariance(data,mean) method to save duplication of * effort. * @param data * Data to consider * @return * Unbiased variance of the given dataset */ static public double computeVariance( Collection<? extends Number> data ) { return computeMeanAndVariance(data).getSecond(); }
/** * Returns the source/dest pair for the edge stored at index i * * @param i The edge index * @return the source/dest pair for the edge stored at index i */ public Pair<Integer, Integer> getEdgePair(int i) { UniqueEdge e = getEdge(i).getFirst(); return new DefaultPair<>(e.idxi, e.idxj); }
/** * Creates a new {@code DefaultInputOutputPair} using the first element of * the given pair as the input and the second element of the given pair as * the output. * * @param pair * The pair to get the input and output from. */ public DefaultInputOutputPair( final Pair<? extends InputType, ? extends OutputType> pair) { this(pair.getFirst(), pair.getSecond()); }
/** * Computes the variance (second central moment, squared standard deviation) * of a dataset. Computes the mean first, then computes the variance. If * you already have the mean, then use the two-argument * computeVariance(data,mean) method to save duplication of effort * @param data * Collection of Vector to consider * @return * Variance of the given dataset */ static public Matrix computeVariance( Collection<? extends Vector> data ) { Pair<Vector,Matrix> result = computeMeanAndCovariance(data); return (result != null) ? result.getSecond() : null; }
/** * Creates a balanced KDTree from the given points. * * @param points Points to load into the KDTree. */ public KDTree( Collection<? extends PairType> points) { this(CollectionUtil.asArrayList(points), new PairFirstVectorizableIndexComparator(0), CollectionUtil.getFirst(points).getFirst().convertToVector().getDimensionality(), null); }
/** * Creates a new {@code DefaultInputOutputPair} using the first element of * the given pair as the input and the second element of the given pair as * the output. * * @param pair * The pair to get the input and output from. */ public DefaultInputOutputPair( final Pair<? extends InputType, ? extends OutputType> pair) { this(pair.getFirst(), pair.getSecond()); }
/** * Computes the unbiased variance (second central moment, * squared standard deviation) of a dataset. Computes the mean first, * then computes the variance. If you already have the mean, then use the * two-argument computeVariance(data,mean) method to save duplication of * effort. * @param data * Data to consider * @return * Unbiased variance of the given dataset */ static public double computeVariance( Collection<? extends Number> data ) { return computeMeanAndVariance(data).getSecond(); }
/** * Creates a balanced KDTree from the given points. * * @param points Points to load into the KDTree. */ public KDTree( Collection<? extends PairType> points) { this(CollectionUtil.asArrayList(points), new PairFirstVectorizableIndexComparator(0), CollectionUtil.getFirst(points).getFirst().convertToVector().getDimensionality(), null); }
/** * Creates a new {@code DefaultInputOutputPair} using the first element of * the given pair as the input and the second element of the given pair as * the output. * * @param pair * The pair to get the input and output from. */ public DefaultInputOutputPair( final Pair<? extends InputType, ? extends OutputType> pair) { this(pair.getFirst(), pair.getSecond()); }
/** * Computes the unbiased variance (second central moment, * squared standard deviation) of a dataset. Computes the mean first, * then computes the variance. If you already have the mean, then use the * two-argument computeVariance(data,mean) method to save duplication of * effort. * @param data * Data to consider * @return * Unbiased variance of the given dataset */ static public double computeVariance( Collection<? extends Number> data ) { return computeMeanAndVariance(data).getSecond(); }
/** * Creates a balanced KDTree from the given points. * * @param points Points to load into the KDTree. */ public KDTree( Collection<? extends PairType> points) { this(CollectionUtil.asArrayList(points), new PairFirstVectorizableIndexComparator(0), CollectionUtil.getFirst(points).getFirst().convertToVector().getDimensionality(), null); }