Statistics and Machine Learning Toolbox™ supports the following data types for input arguments:
Numeric scalars, vectors, matrices, or arrays having
single- or double-precision entries. These data forms have data type
Examples include response variables, predictor variables, and numeric
Cell arrays of character vectors; character, string, logical, or
categorical arrays; or numeric vectors for categorical variables
representing grouping data. These data forms have data types
double, respectively. An
example is an array of class labels in machine learning.
You can also use nominal or ordinal arrays for categorical
data. However, the
ordinal data types are not recommended.
To work with nominal or ordinal categorical data, use the
categorical data type instead.
Estimation functions might not support signed or unsigned integer data types for nongrouping data.
If you recast a
double numeric vector
NaN values to a signed
or unsigned integer, then the software converts the
NaN elements to
Some functions support tabular arrays for heterogeneous
data (for details, see Tables (MATLAB)). The
table data type contains
variables of any of the data types previously listed. An example is
mixed categorical and numerical predictor data for regression analysis.
For some functions, you can also use dataset arrays for
heterogeneous data. However, the
dataset data type is not recommended. To
work with heterogeneous data, use the
table data type if the estimation function
Functions that do not support the
type support sample data of type
Some functions accept
gpuArray input arguments
so that they execute on the GPU. For the full list of Statistics and Machine Learning Toolbox functions that accept GPU arrays, see Function List (GPU
Some functions accept
tall array input arguments
to work with large data sets. For the full list of Statistics and Machine Learning Toolbox functions that accept tall arrays, see Function List (Tall Arrays).
Some functions accept sparse matrices, i.e., matrix
functions that do not accept sparse matrices, recast the data to a full
matrix by using
Statistics and Machine Learning Toolbox does not support the following data types:
Custom numeric data types, e.g., a variable that is double precision and an object.
Signed or unsigned numeric integers for nongrouping
If you specify data of an unsupported type, then the software might return an error or unexpected results.