Skip to content

RFC / API add option to fit/predict without input validation #21804

@lorentzenchr

Description

@lorentzenchr

Goal

Ideally, this issue helps to sort out an API.

Describe the workflow you want to enable

I'd like to be able to switch on/off:

  1. Parameter validation in fit
  2. Input array validation in fit and predict
  3. All other validation steps in fit and predict (e.g. check_is_fitted)

Something like

model = RandomForestRegressor(validate_params=False)
model.fit(validate_input=False)
model.predict(validated_input=False)

Note that some estimators like Lasso already support check_input in fit.

The main reason to do so is improved performance.

Additional context

Related issues and PRs are #16653, #20657, #21578 (in particular #21578 (comment))
Related discussions: #21810

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions