pdmlabs.experiment.batch.incremental_semi_supervised_experiment#
Classes
Incremental semi-supervised anomaly detection with model retraining. |
- class pdmlabs.experiment.batch.incremental_semi_supervised_experiment.IncrementalSemiSupervisedPdMExperiment(refit_new_method_object: bool = True, refit_new_preprocessor_object: bool = True, *args, **kwargs)#
Bases:
PdMExperimentIncremental semi-supervised anomaly detection with model retraining.
This experiment flavor implements online/incremental learning scenarios: 1. Processes data incrementally over time (not all at once) 2. Optionally retrains method and preprocessor on newly observed data 3. Maintains model adaptation as new patterns emerge
Different from semi-supervised: - Processes scenarios in temporal segments (not monolithic) - Can retrain models as new data arrives - Simulates streaming/online scenarios while using batch methods
Useful for: - Detecting concept drift without full retraining - Systems where data arrives in batches - Simulating online learning behavior - Gradual performance monitoring
- refit_new_method_object#
If True, creates fresh method for increments. If False, updates same method. Default True.
- Type:
bool
- refit_new_preprocessor_object#
If True, creates fresh preprocessor. If False, updates same preprocessor. Default True.
- Type:
bool
- Raises:
IncompatibleMethodException β If method does not implement SemiSupervisedMethodInterface.
ShortScenarioLengthException β If scenario is too short for incremental processing.
Examples
>>> experiment = IncrementalSemiSupervisedPdMExperiment( ... experiment_name='incremental-demo', ... pipeline=pipeline, ... param_space={'method_alpha': [0.1, 1.0]}, ... refit_new_method_object=True, ... num_iteration=20 ... ) >>> results = experiment.execute()
- execute() dict#
Run incremental semi-supervised experiment with model retraining.
Processes data incrementally, optionally retraining models:
For each parameter combination: a. For each target scenarioβs temporal segments:
Fits method (optionally new instance)
Predicts anomaly scores
Applies postprocessor and thresholder
Evaluates current segment
Aggregates across segments
Returns best parameters found
- Returns:
Result dictionary with best_params, best_objective, and threshold.
- Return type:
dict
- Raises:
IncompatibleMethodException β If method is not SemiSupervisedMethodInterface.
ShortScenarioLengthException β If scenario is too short to process incrementally.