API Accept 'auto' option for 'dual' parameter in LinearSVC and LinearSVR - #26093
Conversation
adrinjalali
left a comment
There was a problem hiding this comment.
Thanks for the updates, I'm doing a git grep -A3 LinearSVC to find instances we're missing, and there are some, eg.:
benchmarks/bench_mnist.py: Nystroem(gamma=0.015, n_components=1000), LinearSVC(C=100)
benchmarks/bench_mnist.py- ),
benchmarks/bench_mnist.py- "SampledRBF-SVM": make_pipeline(
benchmarks/bench_mnist.py: RBFSampler(gamma=0.015, n_components=1000), LinearSVC(C=100)
examples/miscellaneous/plot_kernel_approximation.py-nystroem_approx_svm = pipeline.Pipeline(
examples/miscellaneous/plot_kernel_approximation.py: [("feature_map", feature_map_nystroem), ("svm", svm.LinearSVC())]
examples/miscellaneous/plot_kernel_approximation.py-)
examples/miscellaneous/plot_kernel_approximation.py-
examples/model_selection/plot_grid_search_refit_callable.py: ("classify", LinearSVC(random_state=42, C=0.01)),
examples/model_selection/plot_grid_search_refit_callable.py- ]
examples/model_selection/plot_grid_search_refit_callable.py-)
examples/model_selection/plot_precision_recall.py:classifier = make_pipeline(StandardScaler(), LinearSVC(random_state=random_state))
examples/model_selection/plot_precision_recall.py-classifier.fit(X_train, y_train)
examples/model_selection/plot_precision_recall.py: make_pipeline(StandardScaler(), LinearSVC(random_state=random_state))
examples/preprocessing/plot_discretization_classification.py: make_pipeline(StandardScaler(), LinearSVC(random_state=0)),
...I haven't checked them all, but I think there's more.
@scikit-learn/core-devs since this is something used so much, I wonder if we want to change the default. WDYT?
|
Yep, maybe it should be done without changing the default |
|
We previously did similar things for the |
|
True that I did not think about changing the examples and benchmark. |
|
Could you please send a commit with |
|
@adrinjalali will do |
adrinjalali
left a comment
There was a problem hiding this comment.
I'm going to give @scikit-learn/core-devs a few days to object here (if any), otherwise happy to merge in a few days.
Thanks for the awesome work @glevv
Fixes #24651
closes #24731
🤖 Generated by Copilot at cd87daa
Set
dualto "auto" forLinearSVCandLinearSVRin some tests to avoid future warnings. This is a temporary fix for compatibility with the upcoming version of scikit-learn.