Developer Guide and Reference

• 2021.3
• 06/28/2021
• Public Content
Contents

Polynomial kernel

The Polynomial kernel is a popular kernel function used in kernelized learning algorithms. It represents the similarity of training samples in a feature space of polynomials of the original data and allows to fit non-linear models.
 Operation Computational methods Programming Interface

Programming Interface

All types and functions in this section are declared in the
oneapi::dal::polynomial_kernel
namespace and are available via inclusion of the
oneapi/dal/algo/polynomial_kernel.hpp
Descriptor
template<typename
Float
= float, typename
Method
= method::by_default, typename
class
descriptor
Template Parameters
• Float
– The floating-point type that the algorithm uses for intermediate computations. Can be
float
or
double
.
• Method
– Tag-type that specifies an implementation of algorithm. Can be
method::dense
.
– Tag-type that specifies the type of the problem to solve. Can be
.
Constructors
descriptor
() = default
Creates a new instance of the class with the default property values.
Properties
double
scale
The coefficient of the polynomial kernel.
Default value
: 1.0.
Getter & Setter

double get_scale() const
auto & set_scale(double value)

double
shift
The coefficient of the polynomial kernel.
Default value
: 0.0.
Getter & Setter

double get_shift() const
auto & set_shift(double value)

std::int64_t
degree
The degree of the polynomial kernel.
Default value
: 3.
Getter & Setter

std::int64_t get_degree() const
auto & set_degree(std::int64_t value)

Method tags
struct
dense
using
by_default
= dense
Alias tag-type for the dense method.
struct
compute
Tag-type that parameterizes entities that are used to compute statistics, distance, and so on.
using
by_default
= compute
Alias tag-type for the compute task.
Training
compute(...)
Input
template<typename
class
compute_input
Template Parameters
– Tag-type that specifies the type of the problem to solve. Can be
.
Constructors
compute_input
(
const
table &
x
,
const
table &
y
)
Creates a new instance of the class with the given
x
and
y
.
Properties
const
table &
x
An table with the data x, where each row stores one feature vector.
Default value
: table{}.
Getter & Setter

const table & get_x() const
auto & set_x(const table &data)

const
table &
y
An table with the data y, where each row stores one feature vector.
Default value
: table{}.
Getter & Setter

const table & get_y() const
auto & set_y(const table &data)

Result
template<typename
class
compute_result
Template Parameters
– Tag-type that specifies the type of the problem to solve. Can be
.
Constructors
compute_result
()
Creates a new instance of the class with the default property values.
Properties
const
table &
values
A table with the result kernel functions.
Default value
: table{}.
Getter & Setter

const table & get_values() const
auto & set_values(const table &value)

Operation
template<typename
Descriptor
> polynomial_kernel::compute_result
compute
(
const
Descriptor &
desc
,
const
polynomial_kernel::compute_input &
input
)
Parameters
• desc
– Polynomial Kernel algorithm descriptor
polynomial_kernel::descriptor
• input
– Input data for the computing operation
Preconditions

input.x.is_empty == false
input.y.is_empty == false
input.x.column_count == input.y.column_count

Postconditions

result.values.has_data == true
result.values.row_count == input.x.row_count
result.values.column_count == input.y.row_count

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.