bartpy icon indicating copy to clipboard operation
bartpy copied to clipboard

'numpy.ndarray' object has no attribute 'normalizing_scale'

Open happyle1004 opened this issue 5 years ago • 4 comments

If I use: model = SklearnModel() model.fit(X_train, y_train.to_numpy()) I got 'numpy.ndarray' object has no attribute 'normalizing_scale' this error message.

If I use: model = SklearnModel model.fit(X_train, y_train.to_numpy()) I got 'fit() missing 1 required positional argument: 'y'' this error message.

X_train is a pandas dataframe.

happyle1004 avatar Jul 01 '20 00:07 happyle1004

Has anyone resolved this yet? I am facing the same issue.

shreyaskar123 avatar Jul 22 '21 20:07 shreyaskar123

In the data.py file i changed line 217 from: self.original_y_min, self.original_y_max = y.min(), y.max()

to: self.original_y_min, self.original_y_max = np.min(y),np.max(y)

and it works for me Screen Shot 2021-10-30 at 11 22 27 PM

ahmedlebo avatar Oct 30 '21 21:10 ahmedlebo

If anyone still needs help with this, I installed this branch:

pip install git+https://github.com/JakeColtman/bartpy.git@pytorch --upgrade

And the error no longer appeared.

emc5ud avatar Nov 30 '21 16:11 emc5ud

Any chance of getting this fix @emc5ud into the master branch / release code? Cheers

watson-sam avatar May 17 '22 05:05 watson-sam