-5

if i use lightgbm

there is two methods of using lightgbm. first method: -

model=lgb.LGBMClassifier()
model.fit(X,y)
model.predict_proba(values)

i can get predict_proba method to predict probabilities. if i use it natively

import lightgbm as lgb
dset = lgb.Dataset(X, label=y)
params = {}
params['learning_rate'] = 0.003
params['boosting_type'] = 'gbdt'
params['objective'] = 'binary'
params['metric'] = 'binary_logloss'
model = lgb.train(params, dset, 100)

I can get predict method but predict_proba method dont exist if i use this method. anyone can advise what i did wrong?

desmond
  • 1,853
  • 4
  • 21
  • 27
  • Please create a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). That would mean 1. mentioning the version of `lightgbm` you are using 2. including the specific text of any logs or errors that have led you to conclude "predict_proba method doesn't exist" 3. modifying the provided code so anyone can run it (e.g., including code to generate `X` and `y`). – James Lamb Nov 28 '21 at 23:55

1 Answers1

0

You can only use predict_proba in sklearn fit(). It does not exist in lightgbm native train().

ferdy
  • 4,396
  • 2
  • 4
  • 16