技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
data-metrics-validation【数据与研究】Validate auto-sklearn feature and target data, dataset compression, metrics, scoring functions, and resampling choices before running estimators.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task is about preparing inputs or scoring configuration for autosklearn estimators. It is drafted for the autosklearn Python package API compatible with 0.16.0dev / 0.16.0.dev0.
Use this sub-skill for:
InputValidator, FeatureValidator, TargetValidator, and no-training checks before fit().feat_type labels for NumPy/list workflows and allow_string_features behavior.X_test/y_test semantics during fit() and train/test shape/dtype checks.dataset_compression settings and its interaction with custom/predefined splits.make_scorer, custom metrics, metric, multiple optimization metrics, and scoring_functions.resampling_strategy, resampling_strategy_arguments, predefined/custom splitters, CV, holdout, and when to call refit().Route elsewhere instead of expanding this sub-skill:
fit() execution, prediction, persistence, and basic result methods: sibling sub-skill estimators.n_jobs, and parallelism: sibling sub-skill search-and-parallelism.custom-components.metadata-maintenance.Prefer a pandas DataFrame for heterogeneous data. Set dtypes deliberately before fit():
category;bool;string if they are true text features;For NumPy arrays, keep the array numeric. If columns include encoded categorical/text concepts, pass feat_type=["Numerical", "Categorical", ...] to fit() with one label per feature.
Run the bundled no-training helper in demo mode or on a small CSV before configuring an expensive AutoML run:
python scripts/validate_autosklearn_inputs.py --help
python scripts/validate_autosklearn_inputs.py
python scripts/validate_autosklearn_inputs.py --csv train.csv --target label --categorical-columns state,plan --string-columns review_text
Build estimator configuration only after data checks pass. Keep data/metric/split choices together:
import autosklearn.classification
import autosklearn.metrics
automl = autosklearn.classification.AutoSklearnClassifier(
metric=autosklearn.metrics.balanced_accuracy,
scoring_functions=[autosklearn.metrics.precision_macro, autosklearn.metrics.recall_macro],
resampling_strategy="holdout",
resampling_strategy_arguments={"train_size": 0.67, "shuffle": True},
dataset_compression={"memory_allocation": 0.1, "methods": ["precision", "subsample"]},
allow_string_features=True,
)
automl.fit(X_train, y_train, X_test=X_test, y_test=y_test, feat_type=None, dataset_name="my_dataset")
If using CV or a custom/predefined splitter, plan a refit(X_train, y_train) before final predictions unless the downstream task explicitly wants fold-trained model behavior.
AutoSklearnClassifier.fit(X, y, X_test=None, y_test=None, feat_type=None, dataset_name=None).AutoSklearnRegressor.fit(X, y, X_test=None, y_test=None, feat_type=None, dataset_name=None).AutoSklearn2Classifier.fit(X, y, X_test=None, y_test=None, metric=None, feat_type=None, dataset_name=None).InputValidator(feat_type=None, is_classification=False, logger_port=None, allow_string_features=True) with fit(X_train, y_train, X_test=None, y_test=None) and transform(X, y=None).autosklearn.metrics.make_scorer(name, score_func, optimum=1.0, worst_possible_result=0.0, greater_is_better=True, needs_proba=False, needs_threshold=False, needs_X=False, **kwargs).feat_type, and X_test/y_test: references/data-formats.md.dataset_compression, and resampling/refit recipes: references/metrics-and-resampling.md.feat_type with a pandas DataFrame; pandas dtypes are the feature-type contract.needs_proba=True and needs_threshold=True together in a scorer..name across metric and scoring_functions.dataset_compression subsampling with a custom/predefined splitter that depends on exact sample order or size.