Use when implementing or reviewing tpcp self_optimize logic, parameter annotations, Optimize/GridSearch/GridSearchCV usage, and validation workflows that must avoid train-test leakage.
Read ../tpcp-builder/SKILL.md first for the global guardrails.
Also load ../tpcp-basics/SKILL.md for cloning/parameter rules and ../tpcp-datasets/SKILL.md for split semantics.
self_optimize only for algorithm-specific training logic.self_optimize.Optimize(pipeline) for pipelines that implement self_optimize.GridSearch for brute-force search without inner CV.GridSearchCV when hyperparameter search itself needs CV.DummyOptimize if you need a non-optimizable baseline on the same CV folds.OptimizableParameter: changed by self_optimize.HyperParameter: changes how self_optimize behaves but is not changed by it.PureParameter: does not affect self_optimize; only use when you are certain.Parameter over PureParameter.self_optimizeself, or (self, info) from self_optimize_with_info.clone(), so they must be represented as parameters.@make_optimize_safe; Optimize(...) also applies equivalent checks.cross_validate(...) expects an optimizer object, not a bare pipeline.DatasetSplitter.pipeline.safe_run(datapoint).self_optimize instead of GridSearch/OptunaSearch.self_optimize.PureParameter even though it affects training.self_optimize directly in user-facing code instead of using Optimize(...).class MyPipeline(OptimizablePipeline[MyDataset]):
model: Parameter[MyAlgo]
model__weights: OptimizableParameter[np.ndarray]
def __init__(self, model: MyAlgo = cf(MyAlgo())):
self.model = model
def self_optimize(self, dataset: MyDataset, **kwargs):
model = self.model.clone()
self.model = model.self_optimize(...)
return self
https://tpcp.readthedocs.io/en/latest/guides/optimization.htmlhttps://tpcp.readthedocs.io/en/latest/guides/algorithm_evaluation.htmlhttps://tpcp.readthedocs.io/en/latest/guides/algorithm_validation_tpcp.htmlhttps://tpcp.readthedocs.io/en/latest/auto_examples/parameter_optimization/_02_optimizable_pipelines.htmlhttps://tpcp.readthedocs.io/en/latest/auto_examples/parameter_optimization/_03_gridsearch_cv.htmlOptimize, GridSearch, GridSearchCV, and make_optimize_safe