This documentation is for scikit-learn version 0.11-gitOther versions

Citing

If you use the software, please consider citing scikit-learn.

This page

8.24.1.7. sklearn.svm.l1_min_c

sklearn.svm.l1_min_c(X, y, loss='l2', fit_intercept=True, intercept_scaling=1.0)

Return the maximum value for C that yields a model with coefficients and intercept set to zero for l1 penalized classifiers, such as LinearSVC with penalty=’l1’ and linear_model.LogisticRegression with penalty=’l1’.

This value is valid if class_weight parameter in fit() is not set.

Parameters :

X : array-like or sparse matrix, shape = [n_samples, n_features]

Training vector, where n_samples in the number of samples and n_features is the number of features.

y : array, shape = [n_samples]

Target vector relative to X

loss : {‘l2’, ‘log’}, default to ‘l2’

Specifies the loss function. With ‘l2’ it is the l2 loss (a.k.a. squared hinge loss). With ‘log’ it is the loss of logistic regression models.

fit_intercept : bool, default: True

Specifies if the intercept should be fitted by the model. It must match the fit() method paramenter.

intercept_scaling : float, default: 1

when fit_intercept is True, instance vector x becomes [x, intercept_scaling], i.e. a “synthetic” feature with constant value equals to intercept_scaling is appended to the instance vector. It must match the fit() method parameter.

Returns :

l1_min_c: float :

minimum value for C