How to use the causallib.evaluation.weight_evaluator.PropensityEvaluatorPredictions2 function in causallib

To help you get started, we’ve selected a few causallib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM / causallib / causallib / evaluation / weight_evaluator.py View on Github external
def __init__(self, weight_matrix, propensity_matrix, treatment_assignment, treatment_assignment_prediction=None):
        super(PropensityEvaluatorPredictions2, self).__init__(weight_matrix, treatment_assignment,
                                                              treatment_assignment_prediction)
        self.propensity_matrix = propensity_matrix
github IBM / causallib / causallib / evaluation / weight_evaluator.py View on Github external
def _estimator_predict2(self, X, a):
        """Predict on data."""
        weight_prediction = super(PropensityEvaluator, self)._estimator_predict2(X, a)
        propensity_matrix = self.estimator.compute_propensity_matrix(X)
        fold_prediction = PropensityEvaluatorPredictions2(weight_prediction.weight_matrix, propensity_matrix,
                                                          a, weight_prediction.treatment_assignment_prediction)
        return fold_prediction

causallib

A Python package for flexible and modular causal inference modeling

Apache-2.0
Latest version published 3 months ago

Package Health Score

67 / 100
Full package analysis

Similar packages