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 |
||
Mathematical formulation#
Refer to Developer Guide: Polynomial kernel.
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
header file.
Descriptor#
-
template<typename Float = float, typename Method = method::by_default, typename Task = task::by_default>
class descriptor# - Template Parameters:
Constructors
-
descriptor() = default#
Creates a new instance of the class with the default property values.
Properties
-
double scale#
The coefficient \(k\) of the polynomial kernel. Default value: 1.0.
- Getter & Setter
double get_scale() const
auto & set_scale(double value)
-
double shift#
The coefficient \(b\) 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 \(d\) of the polynomial kernel. Default value: 3.
- Getter & Setter
std::int64_t get_degree() const
auto & set_degree(std::int64_t value)
Training compute(...)#
Input#
-
template<typename Task = task::by_default>
class compute_input# - Template Parameters:
Task – Tag-type that specifies the type of the problem to solve. Can be task::compute.
Constructors
-
compute_input(const table &x, const table &y)#
Creates a new instance of the class with the given
x
andy
.
Properties
Result#
-
template<typename Task = task::by_default>
class compute_result# - Template Parameters:
Task – Tag-type that specifies the type of the problem to solve. Can be task::compute.
Constructors
-
compute_result()#
Creates a new instance of the class with the default property values.
Properties
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
- Postconditions