EconML icon indicating copy to clipboard operation
EconML copied to clipboard

StatsModelsLinearRegression needs check_input

Open moprescu opened this issue 5 years ago • 1 comments

If the numpy arrays passed are of type object and not float, then an exception is thrown in param, _, rank, _ = np.linalg.lstsq(WX, wy, rcond=None)

moprescu avatar Nov 22 '19 16:11 moprescu

Simple reproduction:

from econml.sklearn_extensions.linear_model import StatsModelsLinearRegression
from sklearn.linear_model import LinearRegression
import numpy as np

X = np.random.normal(size=(100,5)).astype('O')
y = np.random.normal(size=100)

LinearRegression().fit(X,y)
StatsModelsLinearRegression().fit(X,y)

kbattocchi avatar Mar 28 '22 19:03 kbattocchi