Validation
Check xgb_model type. |
|
Check that xgb_model is built with tree learners. |
|
Check values of xgboost model parameters. |
|
Check that input data X is a numpy array. |
|
Check that interaction_order is 1 or 2. |
|
Check that interaction_list is a numpy array of integer pairs. |
|
Check that depth_variable is None or positive integer. |
|
Sample data from an analytical model. |
|
Compute main effect for the analytical example. |
|
Compute interactions for the analytical example. |
- treehfd.validation.check_xgb_model_type(xgb_model: XGBModel) None
Check xgb_model type.
Check that xgb_model is a xgboost model for regression or classification, respectively of type xgboost.sklearn.XGBRegressor or xgboost.sklearn.XGBClassifier, built with the scikit-learn interface of the xgboost package.
- treehfd.validation.check_xgb_model_learner(config: dict) None
Check that xgb_model is built with tree learners.
- treehfd.validation.check_xgb_params(max_depth: int, n_estimators: int, num_parallel_tree: int, num_target: int) None
Check values of xgboost model parameters.
- treehfd.validation.check_data(X: ndarray, name: str, num_feature: int) None
Check that input data X is a numpy array.
- treehfd.validation.check_interaction_order(interaction_order: int) None
Check that interaction_order is 1 or 2.
- treehfd.validation.check_interaction_list(interaction_list: ndarray | None) None
Check that interaction_list is a numpy array of integer pairs.
- treehfd.validation.check_depth_variable(depth_variable: int | None) None
Check that depth_variable is None or positive integer.
- treehfd.validation.sample_data(nsample: int) tuple
Sample data from an analytical model.
Data is sampled from a specific example with Gaussian inputs and a regression function defined from a mix of linear an sinusoidal functions with second-order interactions.
- treehfd.validation.eta_main(x: ndarray, rho: float) ndarray
Compute main effect for the analytical example.
- treehfd.validation.eta_order2(x: ndarray, z: ndarray, rho: float) ndarray
Compute interactions for the analytical example.