odtlearn.utils.validation
#
Module Contents#
Functions#
|
This function checks the propensity weights and counterfactual predictions |
|
This function checks the propensity weights and counterfactual predictions |
|
This function checks the shape and contents of the observed outcomes |
|
Check that the column names of a new data frame match the column names used when used to fit the model |
|
|
|
|
|
Check if a DataFrame G has the columns of X |
- odtlearn.utils.validation.check_ipw(X, ipw)[source]#
This function checks the propensity weights and counterfactual predictions
- Parameters:
- X: The input/training data
- ipw: A vector or array-like object for inverse propensity weights. Only needed when running IPW/DR
- Returns:
- The converted version of ipw after passing the series of checks
- odtlearn.utils.validation.check_y_hat(X, treatments, y_hat)[source]#
This function checks the propensity weights and counterfactual predictions
- Parameters:
- X: The input/training data
- treatments: A vector of the unique treatment values in the dataset.
- y_hat: A multi-dimensional array-like object for counterfactual predictions. Only needed when running DM/DR
- Returns:
- The converted versions of ipw and y_hat after passing the series of checks
- odtlearn.utils.validation.check_y(X, y)[source]#
This function checks the shape and contents of the observed outcomes
- Parameters:
- X: The input/training data
- y: A vector or array-like object for the observed outcomes corresponding to treatment t
- Returns:
- The converted version of y after passing the series of checks
- odtlearn.utils.validation.check_columns_match(original_columns, new_data)[source]#
Check that the column names of a new data frame match the column names used when used to fit the model
- Parameters:
- original_columns: List of column names from the data set used to fit the model
- new_data: The numpy matrix or pd dataframe new data set for
- which we want to make predictions
- Returns:
- ValueError if column names do not match, otherwise None