API Reference¶
This is the class and function reference of PiML. Please refer to the user guide for further details, as the class and function raw specifications may not be enough to give full guidelines on their uses.
Data Pipeline¶
Functions¶
|
Load data for experimentation. |
|
Summarize basic data statistics. |
|
Prepare data for model fitting. |
|
Check the data quality and remove outliers. |
|
Run exploratory data analysis. |
|
Select features that are important for modeling. |
|
Get the preprocessed train-test data. |
Get the raw train-test data. |
|
Get the input feature names. |
|
Get the data type of each input feature. |
|
Get the target feature name. |
Outlier Detection Algorithms¶
A wrapper of sklearn's PCA for outlier detection. |
|
Cluster-based local outlier factor for outlier detection. |
|
Recursive unsupervised splitting tree via KMeans (K=2). |
|
A wrapper of sklearn's Isolation Forest for outlier detection. |
|
A wrapper of sklearn's OneClassSVM for outlier detection. |
|
A wrapper of sklearn's K-Nearest Neighbor-based for outlier detection. |
|
A wrapper of PyOD's Histogram-based outlier detection (HBOS) for outlier detection. |
|
A wrapper of PyOD's Cumulative Distribution Functions (ECOD) for Unsupervised Outlier Detection. |
Model Training¶
|
Fit interpretable models. |
|
Refit a model with new parameters. |
|
Save a PiML-trained model as a pickle file. |
|
Interpret inherently interpretable models. |
|
Customize a pipeline. |
|
Register a pipeline. |
Get the list of names of all registered models. |
|
Get the list of names of all registered interpretable models. |
|
|
Get a registered pipeline. |
|
Get the configuration of a model. |
|
Show the performance comparison table of all trained models. |
|
Show the performance comparison table of all registered models. |
Post-hoc Explainability¶
|
Explain an arbitrary fitted model using post-hoc explanation tools. |
Interpretable Models¶
A wrapper of generalized linear model regressor in scikit-learn. |
|
A wrapper of generalized linear model classifier in scikit-learn. |
|
A wrapper of generalized additive model regressor in pygam. |
|
A wrapper of generalized additive model classifier in pygam. |
|
A wrapper of the decision tree regressor in scikit-learn. |
|
A wrapper of the decision tree classifier in scikit-learn. |
|
Fast interpretable greedy-tree sums regressor. |
|
Fast interpretable greedy-tree sums classifier. |
|
Depth-1 XGBoostClassifier with optimal binning. |
|
Depth-1 XGBoostRegressor with optimal binning. |
|
Depth-2 XGBoostClassifier. |
|
Depth-2 XGBoostRegressor. |
|
An Explainable Boosting Regressor based on interpret==0.4.2 |
|
An Explainable Boosting Classifier based on interpret==0.4.2 |
|
Generalized additive model with pairwise interaction regressor. |
|
Generalized additive model with pairwise interaction classifier. |
|
Multi-layer perceptron regressor with ReLU activation function. |
|
Multi-layer perceptron classifier with ReLU activation function. |
Outcome Testing¶
Integrated Functions¶
|
Test model performance using various diagnostic tools. |
|
Compare the diagnostic results of multiple models. |
|
Test model fairness. |
|
Compare the fairness results of multiple models. |
|
Test model fairness based on solas-ai. |
|
Test model performance using various diagnostic tools after bucketing. |
Scored Test Function¶
Get accuracy result. |
|
Get marginal residual plot based on a given feature. |
|
Plot confusion matrix, ROC and Recall-Precision, only supports classifiers. |
|
Get marginal weakspot result based on a given feature. |
|
Get marginal overfit result based on a given feature. |
|
Get empirical coverage and average bandwidth for regression or Brier Loss for classification. |
|
Compare data distance between reliable and unreliable samples. |
|
Get marginal slicing reliability result based on a given feature. |
|
Get reliability diagram, only for classifiers. |
|
Get the calibrated predicted probability vs. |
|
Get resilience test result in each step. |
|
Compare data distance between samples in the worst region and the remaining region. |
|
Compare marginal distribution histogram between the worst region and remaining region. |
|
Compare marginal distribution density between the worst region and remaining region. |