Code Monkey home page Code Monkey logo

lightgbm-with-focal-loss's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lightgbm-with-focal-loss's Issues

After 78 iterations, the loss returned nan

Hi. Thanks for this implementation.
I had a problem:

/var/folders/tx/5cvg8b910f31k6ttxp5ds9cxbmnldx/T/ipykernel_14194/2624284624.py:26: RuntimeWarning: overflow encountered in exp
  p = 1/(1+np.exp(-x))
/var/folders/tx/5cvg8b910f31k6ttxp5ds9cxbmnldx/T/ipykernel_14194/2624284624.py:27: RuntimeWarning: divide by zero encountered in log
  return -( a*t + (1-a)*(1-t) ) * (( 1 - ( t*p + (1-t)*(1-p)) )**g) * ( t*np.log(p)+(1-t)*np.log(1-p) )
/var/folders/tx/5cvg8b910f31k6ttxp5ds9cxbmnldx/T/ipykernel_14194/2624284624.py:27: RuntimeWarning: invalid value encountered in multiply
  return -( a*t + (1-a)*(1-t) ) * (( 1 - ( t*p + (1-t)*(1-p)) )**g) * ( t*np.log(p)+(1-t)*np.log(1-p) )

Do you know what could it be?
The problem is a multiclass classification with 30 classes.

No Multithreading

hi, when I use lightgbm with focal loss, it can not open multithreading. The CPU only use 100%.

Exact formulas

Hey there! Just wanted to let you know I put some work into deriving exact formulas, which avoids the need for numeric differentiation. I also found out that to be correct, the initialization value of the gradient boosting algorithm has to be accounted for. I've written about this in a blog post.

Kind regards :)

error in best

I am using my own dataset with X and Y read in as Pandas dataframes (followed by train-valid-split)

I'm getting the following error in best.
best = fmin(fn=objective,
space=space,
algo=tpe.suggest,
max_evals=5,
trials=trials)
ValueError Traceback (most recent call last)
in
7 algo=tpe.suggest,
8 max_evals=5,
----> 9 trials=trials)

--> 729 self.pandas_categorical)
730 label = _label_from_pandas(label)
731 self.data_has_header = False

~\Anaconda3\envs\tensorflow-gpu+SHAP\lib\site-packages\lightgbm\basic.py in _data_from_pandas(data, feature_name, categorical_feature, pandas_categorical)
245 if len(data.shape) != 2 or data.shape[0] < 1:
246 raise ValueError('Input data must be 2 dimensional and non empty.')
--> 247 if feature_name == 'auto' or feature_name is None:
248 data = data.rename(columns=str)
249 cat_cols = data.select_dtypes(include=['category']).columns

all of my features have names; the feature_names are
Index(['acft_make_CESSNA', 'acft_make_PIPER', 'acft_make_BEECH',
'acft_make_LUSCOMBE', 'acft_make_PITTS', 'acft_make_CHAMPION',
'acft_make_MOONEY', 'acft_make_NORTH AMERICAN', 'acft_make_BELLANCA',
'acft_make_AERONCA',
...
'pc_profession_ENGR', 'pc_profession_DOCD', 'pc_profession_PMIL',
'pc_profession_OCP ', 'pc_profession_FARA', 'pc_profession_UNK',
'pc_profession_N ', 'pc_profession_Y ', 'pc_profession_NOCP',
'pc_profession_CLGY'],
dtype='object', length=790)

Any ideas to what might be wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.