JakeColtman / bartpy

Bayesian Additive Regression Trees For Python
https://jakecoltman.github.io/bartpy/
MIT License
219 stars 44 forks source link

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

Open happyle1004 opened 4 years ago

happyle1004 commented 4 years ago

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.

shreyaskar123 commented 3 years ago

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

ahmedlebo commented 2 years ago

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

emc5ud commented 2 years ago

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.

watson-sam commented 2 years ago

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