This manual will describe the API in the pcit package
Type
Class
Description
An estimator of the type MetaEstimator is a collection of methods and routines that are needed to automatically find optimal prediction functionals for prediction tasks. In particular, it combines automatically determining if the task is regression or classification, finding the optimal prediction functional through the usage of ensembling methods, and implements routines to get the correct residuals
Attributes
- method: ensembling method [stacking (default), multiplexing, or None]ensembling method]
-
estimators: tuple with two lists of sklearn estimators, regression and classification default is None, in which case predefined estimator lists are used
-
method_type: ‘regr’ or ‘classif’, default is None, which denotes automatic detection if regression or classification problem
- cutoff_categorical: if unique values in outcome are below this thre classification
Functions
- get_estimators: Returns appropriate set of baseline estimators
- fit: Returns the fitted informed estimators
- fit_baseline: Returns a uninformed baseline (loss-optimal predictor with no predictors used)
- predict: Returns predictions
- get_residuals: Returns the appropriate loss residuals for a training and test set
PCIT
Conditional independence test using predictive inference to detect if two variables are conditionally independent given z, where z can be an empty set (= None) (for a marginal independence test)
Attributes:
- x: One of the two variables for which independence is assessed, shape: [samples x dimensions]
- y: The other variable for which independence is assessed, shape: [samples x dimensions]
- z: Conditioning set, shape: [samples x dimensions]
- estimator: object of the MetaEstimator class
- parametric: determines test for the residuals, True results in a t-test, False in a wilcoxon
- confidence: confidence level for test, controls the family-wise error rate
- symmetric: should the test by symmetric (x and y can be interchanged for some results), or one-sided, where the result says if x adds to prediction of y
Returns:
- p_values_adj: adjusted p_values for each variable in y
- which_predictable: which variable in y can be predicted better using the information in x
- independent: tuple, first values is 1 if independent, otherwise 0, second value is p_value of statement
- conf_int_out: confidence interval for difference in prediction error for each y
find_neighbours
Undirected graph skeleton learning routine, using the PCIT.
Attributes:
- X: data set for undirected graph estimation, size: [samples x dimensions]
- estimator: object of the MetaEstimator class
- confidence: false-discovery rate level
Returns:
- skeleton: Matrix (graph) with entries being the p-values for each individual test
- skeleton_adj: Matrix (graph) with skeleton, after application of FDR control