Classes | |
| struct | Params |
Functions | |
| template<typename T > | |
| int | fit (const raft::handle_t &handle, const Params ¶ms, const std::size_t nRows, const std::size_t nCols, const int nClasses, const T *classes, const T *X, const T *y, const T *sampleWeight, T *w, T *probScale) |
| Fit a linear SVM model. More... | |
| template<typename T > | |
| void | computeProbabilities (const raft::handle_t &handle, const std::size_t nRows, const int nClasses, const T *probScale, T *scores, T *out) |
| Compute probabilities from decision function scores. More... | |
| void ML::SVM::linear::computeProbabilities | ( | const raft::handle_t & | handle, |
| const std::size_t | nRows, | ||
| const int | nClasses, | ||
| const T * | probScale, | ||
| T * | scores, | ||
| T * | out | ||
| ) |
Compute probabilities from decision function scores.
| [in] | handle | the cuML handle. |
| [in] | nRows | the number of input samples. |
| [in] | nClasses | the number of input classes. |
| [in] | probScale | the probability scales, shape=(nClasses, 2), F-contiguous. |
| [in,out] | scores | the decision function scores, shape=(nRows, nClasses), C-contiguous. Note that this array will be mutated in-place during the calculation. |
| [out] | out | the computed probabilities, shape=(nRows, nClasses), C-contiguous. |
| int ML::SVM::linear::fit | ( | const raft::handle_t & | handle, |
| const Params & | params, | ||
| const std::size_t | nRows, | ||
| const std::size_t | nCols, | ||
| const int | nClasses, | ||
| const T * | classes, | ||
| const T * | X, | ||
| const T * | y, | ||
| const T * | sampleWeight, | ||
| T * | w, | ||
| T * | probScale | ||
| ) |
Fit a linear SVM model.
| [in] | handle | the cuML handle. |
| [in] | params | the model parameters. |
| [in] | nRows | the number of input samples. |
| [in] | nCols | the number of feature dimensions. |
| [in] | nClasses | the number of input classes, or 0 for a regression problem. |
| [in] | classes | the unique input classes, shape=(nClasses,), or nullptr for a regression problem. |
| [in] | X | the training data, shape=(nRows, nCols), F-contiguous |
| [in] | y | the target data, shape=(nRows,) |
| [in] | sampleWeight | non-negative weights for the training data, shape=(nRows,), or nullptr if unweighted. |
| [out] | w | the fitted weights, shape=(nCoefs, nCols) or (nCoefs + 1, nCols + 1) if fit_intercept=true, where nCoefs = 1 for regression or if nClasses = 2, and nClasses otherwise. F-contiguous. |
| [out] | probScale | the fitted probability scales, shape=(nClasses, 2), F-contiguous. Pass nullptr to not fit probability scales. |