Code Monkey home page Code Monkey logo

Comments (4)

Craigacp avatar Craigacp commented on May 22, 2024

We don't have an implementation of SMOTE, we tend to use example weighting to deal with imbalanced classes, and XGBoost has worked extremely well for that (we've deployed it in production on a severely imbalanced problem). If you want to contribute an implementation of SMOTE that would be pretty useful, but we're not likely to get to implement it ourselves any time soon.

Oversampling can be achieved using a user supplied function to generate the indices supplied to a DatasetView. This is similar to how we create the boostraps in BaggingTrainer or the resampling in AdaBoostTrainer. The AdaBoostTrainer creates a weighted bootstrap sample, which in practice oversamples difficult examples and undersamples easy examples (as defined by the AdaBoost.SAMME algorithm).

Tribuo comes with a built in text pipeline that can create a bag of words representation with term counting in TokenPipeline. If you want to convert that into TF-IDF then you could use the org.tribuo.transform infrastructure, write a custom transformer to calculate IDF, and then rescale all the term count features by the IDF (by applying the transformation). Writing custom transformers is a little tricky, but this one should be fairly straightforward. The transformation infrastructure is briefly discussed in the configuration tutorial.

from tribuo.

nikkisingh111333 avatar nikkisingh111333 commented on May 22, 2024

so in a nutsell you are basically saying that imbalanced data automatically managed under several algorithm we do no need to do much effort for it.that what you are saying ?.

from tribuo.

Craigacp avatar Craigacp commented on May 22, 2024

For Trainers which implement org.tribuo.WeightedExamples then I'd try setting appropriate example weights on the training dataset before building the model instead of performing oversampling. Oversampling loses some information and the reweighting doesn't. If the trainer you want doesn't support that then you can perform oversampling by generating your own indices and constructing a org.tribuo.dataset.DatasetView then use that as the training dataset.

from tribuo.

nikkisingh111333 avatar nikkisingh111333 commented on May 22, 2024

from tribuo.

Related Issues (20)

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.