dowhy.gcm.ml package#

Submodules#

dowhy.gcm.ml.autogluon module#

dowhy.gcm.ml.classification module#

class dowhy.gcm.ml.classification.ClassificationModel[source]#

Bases: PredictionModel

abstract property classes: List[str]#
abstract predict_probabilities(X: array) ndarray[source]#
class dowhy.gcm.ml.classification.SklearnClassificationModel(sklearn_mdl: Any)[source]#

Bases: SklearnRegressionModel, ClassificationModel

property classes: List[str]#
clone()[source]#

Clones the prediction model using the same hyper parameters but not fitted. :return: An unfitted clone of the prediction model.

predict_probabilities(X: array) ndarray[source]#
class dowhy.gcm.ml.classification.SklearnClassificationModelWeighted(sklearn_mdl: Any)[source]#

Bases: SklearnRegressionModelWeighted, ClassificationModel

property classes: List[str]#
clone()[source]#

Clones the prediction model using the same hyper parameters but not fitted. :return: An unfitted clone of the prediction model.

predict_probabilities(X: array) ndarray[source]#
dowhy.gcm.ml.classification.create_ada_boost_classifier(**kwargs) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_extra_trees_classifier(**kwargs) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_gaussian_nb_classifier(**kwargs) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_gaussian_process_classifier(**kwargs) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_hist_gradient_boost_classifier(**kwargs) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_knn_classifier(**kwargs) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_logistic_regression_classifier(**kwargs) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_polynom_logistic_regression_classifier(degree: int = 3, **kwargs_logistic_regression) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_random_forest_classifier(**kwargs) SklearnClassificationModel[source]#
dowhy.gcm.ml.classification.create_support_vector_classifier(**kwargs) SklearnClassificationModel[source]#

dowhy.gcm.ml.prediction_model module#

class dowhy.gcm.ml.prediction_model.PredictionModel[source]#

Bases: object

Represents general prediction model implementations. Each prediction model should provide a fit and a predict method.

abstract clone()[source]#

Clones the prediction model using the same hyper parameters but not fitted.

Returns:

An unfitted clone of the prediction model.

abstract fit(X: ndarray, Y: ndarray) None[source]#
abstract predict(X: ndarray) ndarray[source]#

dowhy.gcm.ml.regression module#

class dowhy.gcm.ml.regression.InvertibleExponentialFunction[source]#

Bases: InvertibleFunction

evaluate(X: ndarray) ndarray[source]#

Applies the function on the input.

evaluate_inverse(X: ndarray) ndarray[source]#

Returns the outcome of applying the inverse of the function on the inputs.

class dowhy.gcm.ml.regression.InvertibleFunction[source]#

Bases: object

abstract evaluate(X: ndarray) ndarray[source]#

Applies the function on the input.

abstract evaluate_inverse(X: ndarray) ndarray[source]#

Returns the outcome of applying the inverse of the function on the inputs.

class dowhy.gcm.ml.regression.InvertibleIdentityFunction[source]#

Bases: InvertibleFunction

evaluate(X: ndarray) ndarray[source]#

Applies the function on the input.

evaluate_inverse(X: ndarray) ndarray[source]#

Returns the outcome of applying the inverse of the function on the inputs.

class dowhy.gcm.ml.regression.InvertibleLogarithmicFunction[source]#

Bases: InvertibleFunction

evaluate(X: ndarray) ndarray[source]#

Applies the function on the input.

evaluate_inverse(X: ndarray) ndarray[source]#

Returns the outcome of applying the inverse of the function on the inputs.

class dowhy.gcm.ml.regression.LinearRegressionWithFixedParameter(coefficients: ndarray, intercept: float)[source]#

Bases: PredictionModel

clone()[source]#

Clones the prediction model using the same hyper parameters but not fitted.

Returns:

An unfitted clone of the prediction model.

fit(X: ndarray, Y: ndarray) None[source]#
predict(X: ndarray) ndarray[source]#
class dowhy.gcm.ml.regression.SklearnRegressionModel(sklearn_mdl: Any)[source]#

Bases: PredictionModel

General wrapper class for sklearn models.

clone()[source]#

Clones the prediction model using the same hyper parameters but not fitted. :return: An unfitted clone of the prediction model.

fit(X: ndarray, Y: ndarray) None[source]#
predict(X: array) ndarray[source]#
property sklearn_model: Any#
class dowhy.gcm.ml.regression.SklearnRegressionModelWeighted(sklearn_mdl: Any)[source]#

Bases: SklearnRegressionModel

fit(X: ndarray, Y: ndarray, sample_weight: ndarray | None = None) None[source]#
dowhy.gcm.ml.regression.create_ada_boost_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_elastic_net_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_extra_trees_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_gaussian_process_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_hist_gradient_boost_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_knn_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_lasso_lars_ic_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_lasso_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_linear_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_linear_regressor_with_given_parameters(coefficients: ndarray, intercept: float = 0) LinearRegressionWithFixedParameter[source]#
dowhy.gcm.ml.regression.create_polynom_regressor(degree: int = 2, **kwargs_linear_model) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_random_forest_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_ridge_regressor(**kwargs) SklearnRegressionModel[source]#
dowhy.gcm.ml.regression.create_support_vector_regressor(**kwargs) SklearnRegressionModel[source]#

Module contents#

This module defines implementations of PredictionModel used by the different FunctionalCausalModel implementations, such as PostNonlinearModel or AdditiveNoiseModel.