svm_model.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2023, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 
7 namespace ML {
8 namespace SVM {
9 
10 // Contains array(s) for matrix storage
11 template <typename math_t>
13  int nnz = -1;
14  int* indptr = nullptr;
15  int* indices = nullptr;
16  math_t* data = nullptr;
17 };
18 
23 template <typename math_t>
24 struct SvmModel {
25  int n_support;
26  int n_cols;
27  math_t b;
28 
31  math_t* dual_coefs;
32 
35 
38 
39  int n_classes;
41  math_t* unique_labels;
42 };
43 
44 }; // namespace SVM
45 }; // namespace ML
Definition: dbscan.hpp:18
Definition: svm_model.h:12
int * indptr
Definition: svm_model.h:14
math_t * data
Definition: svm_model.h:16
int nnz
Definition: svm_model.h:13
int * indices
Definition: svm_model.h:15
Definition: svm_model.h:24
int * support_idx
Indices (from the training set) of the support vectors, size [n_support].
Definition: svm_model.h:37
int n_support
Number of support vectors.
Definition: svm_model.h:25
SupportStorage< math_t > support_matrix
Support vector storage - can contain either CSR or dense.
Definition: svm_model.h:34
math_t * dual_coefs
Definition: svm_model.h:31
math_t * unique_labels
Device pointer for the unique classes. Size [n_classes].
Definition: svm_model.h:41
int n_classes
Definition: svm_model.h:39
int n_cols
Number of features.
Definition: svm_model.h:26
math_t b
Constant used in the decision function.
Definition: svm_model.h:27