Custom components

From VectorSpaceLab/AREX-Skill · View interactive version

Custom components is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Extend auto-sklearn with custom classifiers, regressors, feature preprocessors, data preprocessors, ConfigSpace search spaces, registration, and component IDs.

How to use this skill

Skill file

custom-components

Use this sub-skill when a task needs to author, repair, register, or restrict

auto-sklearn components rather than merely run an existing estimator. The package

imports as autosklearn; the inspected package version was 0.16.0dev /

0.16.0.dev0.

Route here for

fit(), predict(), predict_proba(), and transform() for custom

components.

add_preprocessor() registry functions.

registration.

exposes fewer hyperparameters or narrower ranges.

Route elsewhere

usage: use CODE0.

configuration with no custom component code: use

CODE0.

dataset compression: use

CODE0.

sub-skill. Validate the class, registry entry, and configuration space first.

Operating procedure

  1. Identify the component kind and registry:

autosklearn.pipeline.components.classification.add_classifier, include key

"classifier".

autosklearn.pipeline.components.regression.add_regressor, include key

"regressor".

registry autosklearn.pipeline.components.feature_preprocessing.add_preprocessor,

include key "feature_preprocessor".

autosklearn.pipeline.components.data_preprocessing.add_preprocessor,

include key "data_preprocessor".

  1. Read CODE0

before editing code. It contains the required properties, constants, built-in

IDs, registry rules, and ConfigSpace rules.

  1. If a safe starting file is useful, generate a no-training template:

python scripts/component_skeleton.py --kind classifier --class-name MyClassifier

or write it with --output my_components.py.

  1. Keep the registration call in code that is imported before constructing the

auto-sklearn estimator. For custom components, the ID used in include /

exclude is the class name, for example {"classifier": ["MyClassifier"]}.

  1. Validate without long training: import the module, call get_properties(),

call get_hyperparameter_search_space(), register the class, and confirm the

choice appears in the relevant component catalog or estimator configuration

space.

  1. For complete recipes, use CODE0.

For errors, use CODE0.

Quick validation snippets

Classifier registry check after importing the module that defines the class:

from autosklearn.pipeline.components.classification import ClassifierChoice, add_classifier
from my_components import MyClassifier

add_classifier(MyClassifier)  # harmless if your module did not self-register
props = MyClassifier.get_properties()
required = {
    "shortname", "name", "handles_regression", "handles_classification",
    "handles_multiclass", "handles_multilabel", "handles_multioutput",
    "is_deterministic", "input", "output",
}
assert set(props) == required
cs = MyClassifier.get_hyperparameter_search_space()
assert "MyClassifier" in ClassifierChoice.get_components()

Estimator restriction check without starting a long run:

import autosklearn.classification

automl = autosklearn.classification.AutoSklearnClassifier(
    time_left_for_this_task=30,
    per_run_time_limit=10,
    include={"classifier": ["MyClassifier"]},
    initial_configurations_via_metalearning=0,
    smac_scenario_args={"runcount_limit": 1},
)
# Build or inspect the configuration space with tiny in-memory X/y before any
# expensive fit. If the ID is wrong, this should fail before training.

Native evidence anchors for later verification

Relevant native candidates are the component registration unit checks, component

base-contract checks, and the extension examples. The extension examples are

fit-heavy and should remain skip-expensive unless a verifier deliberately bounds

them; prefer the bundled skeleton --help check and static registry/config-space

checks first.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.