make_dataset#

Entry point to create a dataset from the provided parameters.

Description and Assumptions

The oneapi::math::stats::make_dataset function is used to create a dataset from the provided storage of the observations matrix, the number of dimensions and observations, and other parameters.

make_dataset supports the following precisions for data:

T

float

double

make_dataset (buffer version)#

Syntax

namespace oneapi::math::stats {
template<layout ObservationsLayout = layout::row_major, typename Type>
    dataset<sycl::buffer<Type, 1>, ObservationsLayout> make_dataset(
    std::int64_t n_dims,
    std::int64_t n_observations,
    sycl::buffer<Type, 1> observations,
    sycl::buffer<Type, 1> weights = {0},
    sycl::buffer<std::int64_t, 1> indices = {0});
}

Template Parameters

ObservationsLayout

Data layout. The specific values are described in dataset.

Type

Data precision.

Input Parameters

n_dims

The number of dimensions.

n_observations

The number of observations.

observations

Matrix of observations.

weights

Optional parameter. Array of weights of size n_observations. Elements of the array are non-negative members. If the parameter is not specified, each observation has weight equal to 1.

indices

Optional parameter. Array of vector components that are processed. The size of the array is n_dims. If the parameter is not specified, all components are processed.

Throws

oneapi::math::invalid_argument

Exception is thrown when :math: n_dims leq 0, or :math: n_observations leq 0, or observations.get_count() == 0

Return Value

Dataset holding specified parameters.

make_dataset (USM version)#

Syntax

namespace oneapi::math::stats {
template<layout ObservationsLayout = layout::row_major, typename Type>
    dataset<Type*, ObservationsLayout> make_dataset(std::nt64_t
    n_dims, std::int64_t n_observations,
    Type* observations, Type* weights = nullptr, std::int64_t* indices = nullptr);
}

Template Parameters

ObservationsLayout

Data layout. The specific values are described in dataset.

Type

Data precision.

Input Parameters

n_dims

The number of dimensions.

n_observations

The number of observations.

observations

Matrix of observations.

weights

Optional parameter. Array of weights of size n_observations. Elements of the array are non-negative members. If the parameter is not specified, each observation has weight equal to 1.

indices

Optional parameter. Array of vector components that are processed. Size of array is n_dims. If the parameter is not specified, all components are processed.

Throws

oneapi::math::invalid_argument

Exception is thrown when \(n\_dims \leq 0\), or \(n\_observations \leq 0\), or observations == nullptr

Return Value

Dataset holding specified parameters.

Parent topic: Service Routines