Note
Go to the end to download the full example code or to run this example in your browser via Binder
FIGS Regression (California Housing)¶
Experiment initialization and data preparation
from piml import Experiment
from piml.models import FIGSRegressor
exp = Experiment()
exp.data_loader(data="CaliforniaHousing_trim2", silent=True)
exp.data_prepare(target="MedHouseVal", task_type="regression", silent=True)
Train Model
exp.model_train(model=FIGSRegressor(max_iter=100, max_depth=4), name="FIGS")
Evaluate predictive performance
exp.model_diagnose(model="FIGS", show="accuracy_table")
MSE MAE R2
Train 0.0103 0.0705 0.8196
Test 0.0114 0.0739 0.7941
Gap 0.0012 0.0034 -0.0256
Global interpretation for the splits heatmap
exp.model_interpret(model="FIGS", show="figs_heatmap", tree_idx=0, figsize=(12, 4))
Global interpretation for the first tree
exp.model_interpret(model="FIGS", show="tree_global", root=0, tree_idx=0,
depth=3, original_scale=True, figsize=(16, 10))
Global interpretation for the second tree
exp.model_interpret(model="FIGS", show="tree_global", root=0, tree_idx=1,
depth=3, original_scale=True, figsize=(16, 10))
Local interpretation for the first tree
exp.model_interpret(model="FIGS", show="tree_local", sample_id=0, tree_idx=0,
original_scale=True, figsize=(16, 10))
Local interpretation for the second tree
exp.model_interpret(model="FIGS", show="tree_local", sample_id=0, tree_idx=1,
original_scale=True, figsize=(16, 10))
Total running time of the script: ( 1 minutes 21.194 seconds)
Estimated memory usage: 35 MB