Comments (9)
@rafmacalaba you can try setting categorical_feature in fit_params dictionary that you provide for LOFO.
https://github.com/aerdem4/lofo-importance/blob/master/lofo/lofo_importance.py#L30
lofo_imp = LOFOImportance(dataset, cv=cv, scoring="roc_auc", fit_params={"categorical_feature": ["cat1", "cat2"]})
from lofo-importance.
Ah!! make sense. I just figured it out just now, I added the categorical_feature
parameter in my dict. Thanks :D btw, it would be good if you add that on your README.md :D Thank you so much Ahmet! Please resolve this.
from lofo-importance.
Seems like it doesn't work ❌ @aerdem4
~/anaconda3/lib/python3.7/site-packages/sklearn/model_selection/_validation.py in _fit_and_score(estimator, X, y, scorer, train, test, verbose, parameters, fit_params, return_train_score, return_parameters, return_n_test_samples, return_times, return_estimator, error_score)
526 estimator.fit(X_train, **fit_params)
527 else:
--> 528 estimator.fit(X_train, y_train, **fit_params)
529
530 except Exception as e:
TypeError: fit() got an unexpected keyword argument 'objective'```
from lofo-importance.
@aerdem4 is there a way I can download this specific version 6mos ago? https://www.kaggle.com/divrikwicky/lofo-importance
from lofo-importance.
objective is not fit_params but model parameters, you need to set it while you create your lightgbm model.
If you still want to use an old version you can pip install lofo-importance==0.2.0
from lofo-importance.
@aerdem4 I made it work with some workarounds, I think I found the culprit of my error. specifically in infer_defaults.py
I am using the dtype category
instead of the object
that the one you're using in the script. Might be good to add this in the file.
Thank you!
from lofo-importance.
Can you paste your code that reproduces the error?
from lofo-importance.
@aerdem4 it's just the classic Could not convert to float - string
which any models would be angry to have, basically my categorical features are in category
dtype not object
which was in your infer_defaults.py
script. I made a PR for this and just check if it's good to go :D Thanks!
from lofo-importance.
Solved by #25
from lofo-importance.
Related Issues (20)
- Add logging or restart mechanism HOT 2
- Sample_weight? HOT 2
- Add the choice between Mean/Std and Median/IQR HOT 5
- Having a lot of features + Using LOFO? HOT 3
- usage question HOT 2
- Multiclass models HOT 4
- Groupkfold or Groupshufflesplit Cross Validation HOT 1
- Support multiclass classification ? HOT 2
- TimeSeriesSplit with Lofo HOT 1
- Feature selection using statistical significance
- How to perform feature selection with hyperparameter tuning?
- Returns NaNs all the time HOT 1
- Any tutorial for dealing with genetic data? HOT 2
- Could you add a reference? HOT 1
- Running the example in the readme throws errors
- Compatibility with neural network: replacing with constant value instead of dropping the feature HOT 2
- requirements.txt not packaged in source distribution
- Pandas 2.0.x compatibility HOT 5
- Variable Grouping Only Works When Model Parameter is Kept To Default HOT 5
- Performing feature selection in multi targeted regression dataset HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lofo-importance.