fit_profiler¶
The entry point — profiles a fitted model and returns a
ProfilingResult. See the
Profiling guide for narrative usage.
fit_profiler takes data arguments plus a single typed
ProfilingConfig via config=. Pass the fitted
model, feature matrix X, cohort mask target_mask, optional ground-truth
y, holdout splits, encoding_registry, and task_type directly on the
function; put every tuning knob — clustering geometry, archetype filters,
rule miners, global explanations, EDA, report output — inside
ProfilingConfig. Optional stages are enabled by presence of their section
(rules=RulesConfig(...), explanations=ExplanationsConfig(...), …), not
boolean flags on fit_profiler. Omit config (or pass ProfilingConfig())
for archetype discovery only.
fit_profiler ¶
fit_profiler(
*,
model: Any = None,
X: DataFrame,
shap_values: ndarray | None = None,
predictions: ndarray | None = None,
target_mask: ndarray | Series | None = None,
y: ndarray | Series | None = None,
X_target_orig: DataFrame | None = None,
id_columns: list[str] | None = None,
task_type: TaskType = BINARY,
encoding_registry: EncodingRegistry | None = None,
target_col: str | None = None,
X_valid: DataFrame | None = None,
y_valid: ndarray | Series | None = None,
X_test: DataFrame | None = None,
y_test: ndarray | Series | None = None,
X_holdout: DataFrame | None = None,
y_holdout: ndarray | Series | None = None,
holdout_basis: HoldoutBasis | None = None,
positive_class: Any = None,
served_threshold: float | None = None,
config: ProfilingConfig | None = None
) -> ProfilingResult
Discover archetypes in the target class, explain them, and enable similar-case retrieval.
Fits the profiling pipeline over a model (or precomputed SHAP) and returns
a populated :class:parleml_mli.ProfilingResult — archetype clusters plus, when
their sections are configured, mined rules, global explanations, EDA, and a
written report. For a generic estimator or predictions-only input use
:func:parleml_mli.monitor_predictions instead.
All tuning knobs live in a single typed :class:parleml_mli.ProfilingConfig
(config); the arguments here are strictly the run's data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
fitted native estimator
|
Must be recognised by :func: |
None
|
X
|
DataFrame
|
Full training feature matrix (required). |
required |
shap_values
|
ndarray
|
Raw/logit SHAP |
None
|
predictions
|
ndarray
|
Model scores |
None
|
target_mask
|
ndarray or Series
|
Boolean mask ( |
None
|
y
|
ndarray or Series
|
Ground-truth labels / regression targets aligned with |
None
|
X_target_orig
|
DataFrame
|
Pre-aligned original (clean) features for the target population, stored on the result for signatures, reports, and retrieval. |
None
|
id_columns
|
list[str]
|
Identifier columns (from |
None
|
task_type
|
TaskType
|
|
BINARY
|
encoding_registry
|
EncodingRegistry
|
Describes what each engineered column means; bound to |
None
|
target_col
|
str
|
Name of the target column |
None
|
X_valid
|
optional
|
Holdout splits aligned with |
None
|
y_valid
|
optional
|
Holdout splits aligned with |
None
|
X_test
|
optional
|
Holdout splits aligned with |
None
|
y_test
|
optional
|
Holdout splits aligned with |
None
|
X_holdout
|
optional
|
Held-out rows — rows the rule search never saw, and ideally the model
neither ( |
None
|
y_holdout
|
optional
|
Held-out rows — rows the rule search never saw, and ideally the model
neither ( |
None
|
holdout_basis
|
HoldoutBasis
|
Where the held-out rows come from, stamped on every rule set. |
None
|
positive_class
|
optional
|
The positive label of a binary |
None
|
served_threshold
|
float
|
The deployed model's published binary cut on these predictions'
scale; wins over |
None
|
config
|
ProfilingConfig
|
All tuning knobs, composed from small frozen section dataclasses
( |
None
|
Returns:
| Type | Description |
|---|---|
ProfilingResult
|
The populated result; also written to |