All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.datavec.dataframe.reducing.NumericReduceFunction Maven / Gradle / Ivy

Go to download

High-performance Java Dataframe with integrated columnar storage (fork of tablesaw)

There is a newer version: 0.9.1
Show newest version
package org.datavec.dataframe.reducing;

import org.datavec.dataframe.api.*;

/**
 * Functions that calculate values over the data of an entire column, such as sum, mean, std. dev, etc.
 */
public interface NumericReduceFunction {

  String functionName();

  double reduce(double[] data);

  default double reduce(DoubleColumn data) {
    return this.reduce(data.toDoubleArray());
  }


  default double reduce(FloatColumn data) {
    return this.reduce(data.toDoubleArray());
  }

  default double reduce(IntColumn data) {
    return this.reduce(data.toDoubleArray());
  }

  default double reduce(ShortColumn data) {
    return this.reduce(data.toDoubleArray());
  }

  default double reduce(LongColumn data) {
    return this.reduce(data.toDoubleArray());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy