LinearSVC
#include <Skigen/SVM>
template <typename Scalar = double>
class Skigen::LinearSVC(C=1.0, loss=Loss::SquaredHinge, tol=1e-4, max_iter=1000, fit_intercept=true, random_state=std::nullopt)
Linear SVC — primal sub-gradient SGD on the squared-hinge L2 regularised objective.
Mirrors the binary case of sklearn.svm.LinearSVC; multiclass uses one-vs-rest (default multi_class="ovr").
Solves (loss="squared_hinge", the sklearn default) or the analogous hinge loss when loss="hinge".
Attributes:
-
C : Scalar
-
loss : Loss
-
classes : const Eigen::VectorXi
-
n_classes : int
-
coef : MatrixType
-
intercept : VectorType
Methods
SKIGEN_PARAMS()
fit(X, y)
Fit from a sparse design matrix (densifies internally).
predict(X)
predict(X)
Predict from a sparse design matrix (densifies internally).
decision_function(X)
Raw decision function. Shape is (n_samples,) for binary problems wrapped as a 1-column matrix; (n_samples, n_classes) for multiclass.