demos icon indicating copy to clipboard operation
demos copied to clipboard

QboostRegressor predicts all nan

Open KaiWangCanada opened this issue 6 years ago • 0 comments

When using QboostRegressor predict boston house price, the predict results are all nan.

Source code: ` sa_sampler = dimod.SimulatedAnnealingSampler() DW_PARAMS = {'num_reads': 300, 'num_sweeps': 10}

# data
data = load_boston()
X, y = data.data, data.target

# qboost
clf = QBoostRegressor()
clf.fit(X, y, sa_sampler, lmd=0.7, **DW_PARAMS)
pred_y = clf.predict(X)

print(pred_y)

`

Looks like in the middle of Adaboost process, 'w' sometimes are infinity, because of exponential operation on a large number, e.g. 1000: image

Could you fix it? Thanks!

KaiWangCanada avatar Dec 13 '18 19:12 KaiWangCanada