ensae_teaching_cs.ml.gini (Y, X = None)

Computes the Gini coefficients.

ensae_teaching_cs.ml.LassoRandomForestRegressor (self, rf_estimator = None, lasso_estimator = None)

Fits a random forest and then selects trees by using a Lasso regression. The traning produces the following attributes:

  • rf_estimator_: trained random forest

  • lasso_estimator_: trained Lasso

  • estimators_: trained estimators mapped to a not null coefficients

  • intercept_: bias

  • coef_: estimators weights