ThunderSVM
ThunderSVM: An Open-Source SVM Library on GPUs and CPUs
Public Member Functions | List of all members
KernelMatrix Class Reference

The management class of kernel values. More...

#include <kernelmatrix.h>

Public Member Functions

 KernelMatrix (const DataSet::node2d &instances, SvmParam param)
 
void get_rows (const SyncArray< int > &idx, SyncArray< float_type > &kernel_rows) const
 
void get_rows (const DataSet::node2d &instances, SyncArray< float_type > &kernel_rows) const
 
const SyncArray< float_type > & diag () const
 return the diagonal elements of kernel matrix
 
size_t n_instances () const
 the number of instances in KernelMatrix
 
size_t n_features () const
 the maximum number of features of instances
 
size_t nnz () const
 the number of non-zero features of all instances
 

Detailed Description

The management class of kernel values.

Constructor & Destructor Documentation

◆ KernelMatrix()

KernelMatrix::KernelMatrix ( const DataSet::node2d &  instances,
SvmParam  param 
)
explicit

Create KernelMatrix with given instances (training data or support vectors).

Parameters
instancesthe instances, either are training instances for training, or are support vectors for prediction.
paramkernel_type in parm is used

Member Function Documentation

◆ get_rows() [1/2]

void KernelMatrix::get_rows ( const SyncArray< int > &  idx,
SyncArray< float_type > &  kernel_rows 
) const

return specific rows in kernel matrix

Parameters
[in]idxthe indices of the rows
[out]kernel_rows

◆ get_rows() [2/2]

void KernelMatrix::get_rows ( const DataSet::node2d &  instances,
SyncArray< float_type > &  kernel_rows 
) const

return kernel values of each given instance and each instance stored in KernelMatrix

Parameters
[in]instancesthe given instances
[out]kernel_rows

The documentation for this class was generated from the following files: