Data Types
This documentation is for an out-of-date version of Apache Flink Machine Learning Library. We recommend you use the latest stable version.

Data Types #

Flink ML supports all data types that have been supported by Flink Table API, as well as data types listed in sections below.

Vector #

Flink ML provides support for vectors of double values. A Vector in Flink ML can be either dense(DenseVector) or sparse(SparseVector), depending on how users create them accordig to the vector’s sparsity. Each vector is initialized with a fixed size and users may get or set the double value of any 0-based index location in the vector.

Flink ML also has a class named Vectors providing utility methods for instantiating vectors.

int n = 4;
int[] indices = new int[] {0, 2, 3};
double[] values = new double[] {0.1, 0.3, 0.4};

SparseVector vector = Vectors.sparse(n, indices, values);