8000 Add option gamma='scale' and 'auto' to RBFSampler · Issue #24748 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Add option gamma='scale' and 'auto' to RBFSampler #24748
Closed
@glevv

Description

@glevv

Describe the workflow you want to enable

Right now SVM supports gamma parameter to be set to 'scale' or 'auto', which will automatically determine gamma parameter based on data, but RBFSampler does not support this.

On top of that there is no check on n_components parameter, which allow users to set it to 0 and fit it without errors. It will only raise error if n_components is negative - ValueError: negative dimensions are not allowed (this is numpy error from random.normal generation, not sklearn one).

Describe your proposed solution

Add 'scale' and 'auto' option to RBFSampler

Describe alternatives you've considered, if relevant

It is possible to calculate gamma beforehand on your own, but it become increasingly tiresome if for example someone is performing CV - you will have to use custom loop instead of cross_val_score and others.

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0