You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Further, this caused issues for stacked Global Learners as in Example Gallery
Minimal Example
import doubleml as dml
import sklearn
import numpy as np
import pandas as pd
from sklearn.linear_model import LassoCV
from doubleml.rdd.datasets import make_simple_rdd_data
from doubleml.rdd import RDFlex
from doubleml.utils.global_learner import GlobalRegressor
from sklearn.ensemble import StackingRegressor
print(sklearn.__version__)
print(dml.__version__)
np.random.seed(42)
data_dict = make_simple_rdd_data(n_obs=1000, fuzzy=False)
cov_names = ['x' + str(i) for i in range(data_dict['X'].shape[1])]
df = pd.DataFrame(np.column_stack((data_dict['Y'], data_dict['D'], data_dict['score'], data_dict['X'])), columns=['y', 'd', 'score'] + cov_names)
dml_data = dml.DoubleMLData(df, y_col='y', d_cols='d', x_cols=cov_names, s_col='score')
ml_g = StackingRegressor([("global", GlobalRegressor(LassoCV())),
("local", LassoCV())], final_estimator=LassoCV())
rdflex_obj = RDFlex(dml_data, ml_g, fuzzy=False)
rdflex_obj.fit()
Output:
1.6.0
0.9.3
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[<ipython-input-4-deff49535681>](https://localhost:8080/#) in <cell line: 0>()
20 ("local", LassoCV())], final_estimator=LassoCV())
21 rdflex_obj = RDFlex(dml_data, ml_g, fuzzy=False)
---> 22 rdflex_obj.fit()
6 frames
[/usr/local/lib/python3.11/dist-packages/sklearn/ensemble/_base.py](https://localhost:8080/#) in _validate_estimators(self)
232 for est in estimators:
233 if est != "drop" and not is_estimator_type(est):
--> 234 raise ValueError(
235 "The estimator {} should be a {}.".format(
236 est.__class__.__name__, is_estimator_type.__name__[3:]
ValueError: The estimator GlobalRegressor should be a regressor.
The text was updated successfully, but these errors were encountered:
With scikit-learn
1.6.0
,__sklearn_tags__
were introduces, see Estimator TagsThis raised some issues at
Further, this caused issues for stacked Global Learners as in Example Gallery
Minimal Example
Output:
The text was updated successfully, but these errors were encountered: