Closed fganss closed 5 years ago
I cannot reproduce your error. Can you provide a minimal working example?
Which version of Python and the KTBoost package are you using? You might need to update to the newest version of KTBoost.
The following example works for me (KTBoost version 0.1.8, both with Python 2.7 and 3.6):
import sklearn.datasets as datasets import numpy as np import KTBoost.KTBoost as KTBoost
X, lp = datasets.make_friedman3(n_samples=100) lp=lp*5+0.2
y=np.random.normal(loc=lp,scale=1) yu=8 yl=5 y[y>=yu]=yu y[y<=yl]=yl
KTBoost.BoostingRegressor(loss='tobit', yl=0, yu=1).fit(X, y)
I got this to work by updating the package to the newest version.
I get the following error when trying to apply a Grabit model with KTBoost.BoostingRegressor(loss='tobit', yl=0, yu=1).fit(X, Y):
Traceback (most recent call last): File "", line 2, in
File "...\KTBoost\KTBoost.py", line 1745, in fit begin_at_stage, monitor, X_idx_sorted)
File "...\KTBoost\KTBoost.py", line 1810, in _fit_stages nTreeKernel, X_csc, X_csr)
File "...\KTBoost\KTBoost.py", line 1354, in _fit_stage presort=self.presort)
TypeError: init() got an unexpected keyword argument 'min_weight_leaf'