Linear kernel¶
The linear kernel is the simplest kernel function for pattern analysis.
Operation  | 
Computational methods  | 
Programming Interface  | 
||
Mathematical formulation¶
Refer to Developer Guide: Linear kernel.
Programming Interface¶
All types and functions in this section are declared in the
oneapi::dal::linear_kernel namespace and are available via inclusion of the
oneapi/dal/algo/linear_kernel.hpp header file.
Descriptor¶
- 
template<typename 
Float= float, typenameMethod= method::by_default, typenameTask= task::by_default>
classdescriptor¶ - Template Parameters
 
Constructors
- 
descriptor() = default¶ Creates a new instance of the class with the default property values.
Properties
- 
double 
shift¶ The coefficient \(b\) of the linear kernel. Default value: 0.0.
- Getter & Setter
 double get_shift() constauto & set_shift(double value)
- 
double 
scale¶ The coefficient \(k\) of the linear kernel. Default value: 1.0.
- Getter & Setter
 double get_scale() constauto & set_scale(double value)
Training compute(...)¶
Input¶
- 
template<typename 
Task= task::by_default>
classcompute_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
xandy.
Properties
Result¶
- 
template<typename 
Task= task::by_default>
classcompute_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>
linear_kernel::compute_resultcompute(const Descriptor &desc, const linear_kernel::compute_input &input)¶ - Parameters
 desc – Linear Kernel algorithm descriptor
linear_kernel::descriptor.input – Input data for the computing operation
- Preconditions
 input.data.is_empty == false