Skip to main content

An extension to sklearn.GridSearchCV and RandomizedSearchCV to reduce over and underfitting

Project description

fitsearchcv— A smarter refit selector for scikit-learn searches

selector-mean is a tiny utility that helps reduce overfitting and underfitting when tuning hyperparameters with scikit-learn’s GridSearchCV or RandomizedSearchCV.

It provides a single function:

  • selector_mean(cv_results_, metric=None, use_abs_gap=True, clip01=True)
    A callable you pass to refit=... that picks the parameter set balancing high test performance and small train–test gap.

Why?

Vanilla GridSearchCV usually selects the highest mean test score, which can sometimes favor models with high variance.
selector_mean instead minimizes: 0.5 * (|train - test|) + 0.5 * (1 - test)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fitsearchcv-1.0.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fitsearchcv-1.0.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file fitsearchcv-1.0.0.tar.gz.

File metadata

  • Download URL: fitsearchcv-1.0.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for fitsearchcv-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5df6271d121fcc3062f81980b5280538cb0c3c3dfa4cbe16d1dc49eb8e66f97a
MD5 38089eb771125b1427257f0e6beb7ad6
BLAKE2b-256 a26f6dd339cd0b40b8c1ca4e82628ee5b89f4c2fb2c0bde93e59145c55401c7e

See more details on using hashes here.

File details

Details for the file fitsearchcv-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: fitsearchcv-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for fitsearchcv-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25aaa2aaa15690553fbe50453f2c59212c6f51c6b293ff76067a00e5566c8282
MD5 2b44559b934aff3dcbe3312474a8de6a
BLAKE2b-256 411c43c589609dcffe8c89eb9e5ac7cea36c5be8216b9669b28be11786728c62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page