#include <linear.hpp>
|
| static LinearSVMModel< T > | fit (const raft::handle_t &handle, const LinearSVMParams ¶ms, const T *X, const std::size_t nRows, const std::size_t nCols, const T *y, const T *sampleWeight) |
| | Allocate and fit the LinearSVM model. More...
|
| |
| static LinearSVMModel< T > | allocate (const raft::handle_t &handle, const LinearSVMParams ¶ms, const std::size_t nCols, const std::size_t nClasses=0) |
| | Explicitly allocate the data for the model without training it. More...
|
| |
| static void | free (const raft::handle_t &handle, LinearSVMModel< T > &model) |
| | Free the allocated memory. The model is not usable after the call of this method. More...
|
| |
| static void | predict (const raft::handle_t &handle, const LinearSVMParams ¶ms, const LinearSVMModel< T > &model, const T *X, const std::size_t nRows, const std::size_t nCols, T *out) |
| | Predict using the trained LinearSVM model. More...
|
| |
| static void | decisionFunction (const raft::handle_t &handle, const LinearSVMParams ¶ms, const LinearSVMModel< T > &model, const T *X, const std::size_t nRows, const std::size_t nCols, T *out) |
| | Calculate decision function value for samples in input. More...
|
| |
| static void | predictProba (const raft::handle_t &handle, const LinearSVMParams ¶ms, const LinearSVMModel< T > &model, const T *X, const std::size_t nRows, const std::size_t nCols, const bool log, T *out) |
| | For SVC, predict the probabilities for each outcome. More...
|
| |
◆ allocate()
Explicitly allocate the data for the model without training it.
- Parameters
-
| [in] | handle | the cuML handle. |
| [in] | params | the model parameters. |
| [in] | nCols | the number of feature dimensions. |
| [in] | nClasses | the number of classes in the dataset (not applicable for regression). |
- Returns
- the trained model (don't forget to call
free on it after use).
◆ coefCols()
It's 1 for binary classification or regression; nClasses for multiclass.
◆ decisionFunction()
Calculate decision function value for samples in input.
- Parameters
-
| [in] | handle | the cuML handle. |
| [in] | params | the model parameters. |
| [in] | model | the trained model. |
| [in] | X | the input data matrix of size (nRows, nCols) in column-major format. |
| [in] | nRows | number of vectors |
| [in] | nCols | number of features |
| [out] | out | the decision function value of size (nRows, n_classes <= 2 ? 1 : n_classes) in row-major format. |
◆ fit()
Allocate and fit the LinearSVM model.
- Parameters
-
| [in] | handle | the cuML handle. |
| [in] | params | the model parameters. |
| [in] | X | the input data matrix of size (nRows, nCols) in column-major format. |
| [in] | nRows | the number of input samples. |
| [in] | nCols | the number of feature dimensions. |
| [in] | y | the target - a single vector of either real (regression) or categorical (classification) values (nRows, ). |
| [in] | sampleWeight | the non-negative weights for the training sample (nRows, ). |
- Returns
- the trained model (don't forget to call
free on it after use).
◆ free()
Free the allocated memory. The model is not usable after the call of this method.
◆ predict()
Predict using the trained LinearSVM model.
- Parameters
-
| [in] | handle | the cuML handle. |
| [in] | params | the model parameters. |
| [in] | model | the trained model. |
| [in] | X | the input data matrix of size (nRows, nCols) in column-major format. |
| [in] | nRows | the number of input samples. |
| [in] | nCols | the number of feature dimensions. |
| [out] | out | the predictions (nRows, ). |
◆ predictProba()
For SVC, predict the probabilities for each outcome.
- Parameters
-
| [in] | handle | the cuML handle. |
| [in] | params | the model parameters. |
| [in] | model | the trained model. |
| [in] | X | the input data matrix of size (nRows, nCols) in column-major format. |
| [in] | nRows | the number of input samples. |
| [in] | nCols | the number of feature dimensions. |
| [in] | log | whether to output log-probabilities instead of probabilities. |
| [out] | out | the estimated probabilities (nRows, nClasses) in row-major format. |
◆ classes
Sorted, unique values of input array y.
◆ coefRows
Number of rows of w, which is the number of data features plus maybe bias.
◆ nClasses
Number of classes (not applicable for regression).
◆ probScale
C-style (row-major) matrix of the probabolistic model calibration coefficients. It's empty if LinearSVMParams.probability == false. Otherwise, it's size is (2, coefCols). where coefCols = nClasses == 2 ? 1 : nClasses
C-style (row-major) matrix of coefficients of size (coefRows, coefCols) where coefRows = nCols + (params.fit_intercept ? 1 : 0) coefCols = nClasses == 2 ? 1 : nClasses
The documentation for this struct was generated from the following file: