Rapid Refitting
Rapid refitting allows you to update model parameters in milliseconds without retraining from scratch. Perfect for real-time optimization, A/B testing, and parameter tuning scenarios.
Overview
Rapid refitting is a unique feature of xplainable models that enables instant parameter updates without full retraining. Unlike traditional machine learning models that require complete retraining when parameters change, xplainable models can adjust their activation functions and decision boundaries in real-time.
Key Benefits
- Instant updates: Update model parameters in milliseconds, not minutes or hours
- Real-time optimization: Continuously optimize model performance as new data arrives
- A/B testing: Test different parameter configurations instantly in production
- Interactive tuning: Experiment with parameters and see results immediately
How Rapid Refitting Works
Rapid refitting works by separating the tree structure (which requires full training) from the activation function (which can be updated instantly):
- Tree Structure: The decision tree ensemble is built once during initial training with
fit() - Activation Function: Parameters like
weight,power_degree, andsigmoid_exponentcontrol how leaf values are combined - Instant Updates: Calling
update_feature_params()recalculates predictions without rebuilding trees
- Tree Building: Computationally expensive, done once during
fit() - Activation Function: Lightweight mathematical transformation applied to leaf values
- Rapid Refitting: Updates only the activation function, keeping trees intact
Basic Usage
Simple Parameter Update
The update_feature_params() Method
This is the core method for rapid refitting. It updates the activation function parameters for a specified subset of features.
All parameters are optional -- only the ones you specify will be updated. The features parameter accepts a list of column names. Use model.columns to update all features at once.
Feature-Specific Tuning
One of the most powerful aspects of rapid refitting is the ability to tune different features with different parameters:
Parameter Exploration
Advanced Techniques
Real-Time Optimization with Scipy
Bayesian Optimization with XParamOptimiser
XParamOptimiser uses rapid refitting internally. It trains models once per fold during _instantiate(), then uses update_feature_params() to test different parameter configurations quickly:
Regression-Specific Rapid Refitting
Basic Regression Example
Combining with XEvolutionaryNetwork
Rapid refitting and XEvolutionaryNetwork are complementary. Use rapid refitting for activation function parameters, then XEvolutionaryNetwork for deeper weight optimization:
If a model has been optimized using XEvolutionaryNetwork, calling update_feature_params() will overwrite the optimized leaf weights and the model will need to be re-optimized.
Using Feature Importances
The feature_importances property (not a method call) returns a dictionary of feature importance values:
Performance Benchmarking
Speed Comparison
Best Practices
- Parameter tuning -- Quick exploration of parameter space
- Real-time optimization -- Continuous model improvement
- A/B testing -- Testing different configurations in production
- Interactive analysis -- Immediate feedback during exploration
- Feature-level tuning -- Address under/overfitting on specific features
- Always validate on held-out data -- rapid refitting can overfit just like any tuning method
- Use
model.columnsto update all features -- or pass a subset for targeted tuning - Monitor
feature_importances-- check how parameter changes affect feature contributions - Combine with XParamOptimiser -- let Bayesian optimization search the parameter space systematically
Next Steps
- Explore XEvolutionaryNetwork for deep weight optimization of regression models
- Learn about partitioned models for segment-specific rapid refitting
- Check out custom transformers for preprocessing pipelines