Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@eddiebergman
Copy link
Contributor

@eddiebergman eddiebergman commented Feb 2, 2024

Cleans up some TODO's and makes the CVEvaluator more flexible for experienced users.
Docstrings provided.

pipeline = Component(
    RandomForestClassifier,
    config={
        # Allow it to be configured with n_jobs
        "n_jobs": request("n_jobs", default=None)
    },
    space={"n_estimators": (10, 100), "criterion": ["gini", "entropy"]},
)

evaluator = CVEvaluation(
    X,
    y,
    # Use the `configure` keyword in params to pass to the `n_jobs`
    # Anything in the pipeline requesting `n_jobs` will get the value
    params={"configure": {"n_jobs": 2}}
)
history = pipeline.optimize(...)

Same can be done to interact with build(), for example, to build with an ImblearnPipeline or use your own custom builder.

from imblearn.pipeline import Pipeline as ImbalancedPipeline
CVEvaluator(
    ...,
    params={
        "build": {
            "builder": "sklearn",
            "pipeline_type": ImbalancedPipeline
        }
    }
)

Same exmaples given in docstrings

@eddiebergman eddiebergman added the feature A new feature label Feb 2, 2024
@eddiebergman eddiebergman self-assigned this Feb 2, 2024
@eddiebergman
Copy link
Contributor Author

@LennartPurucker You don't have to review necessarily but I thought you might like to know about this feature whenever you might get to use this ;)

@eddiebergman eddiebergman merged commit 9927dd2 into main Feb 3, 2024
@eddiebergman eddiebergman deleted the feat-more-params-to-sklearn-evaluator branch February 3, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant