Robin Nicole
Robin Nicole

Reputation: 666

Python wrapper arround fasttext train with parameter tuning

I use Fasttext to do classification of toxic comments (the Kaggle competition). To train my model I run the command

fasttext supervised -input model_train.train -output model_tune -autotune-validation model_train.valid -autotune-modelsize 100M -autotune-duration 1200

which train a classification model and do parameters tuning while ensuring the size of the model is below 100M. Is there a python wrapper to train supervised model with -autotune-validation ? I know there is python wrapper for the predict and train method but couldn't find one to train classification models with autotune-validation. Also if on the top of that there is a sklearn wrapper that does the same thing that would be marvelous.

Thanks in advance

Upvotes: 0

Views: 927

Answers (2)

As explained here, python wrapper for fastText automatic hyperparameter optimization has the following syntax:

model_tune = fasttext.train_supervised (input='model_train.train', \
  autotuneValidationFile='model_train.valid', autotuneModelSize='100M', \
  autotuneDuration=1200)

Upvotes: 0

Keval
Keval

Reputation: 11

Yes, you can autotune it using Python by adding autotuneValidationFile parameter to the function.

Ref: https://fasttext.cc/docs/en/autotune.html

Upvotes: 1

Related Questions