0
$\begingroup$

I tried to RTFM, here is the documentation:

https://timeseriesai.github.io/tsai/

I found no mention of how to get rid of the table that is output while training. Here is an example of what I do NOT want it to print:

# Assuming you have X, y, and splits
batch_tfms = TSStandardize()
fcst = TSForecaster(X, y, splits=splits, batch_tfms=batch_tfms, bs=nrows, arch=TST, metrics=mae)
fcst.fit_one_cycle(len(splits[0]), 1e-3)

# I do not want this stuff --+
#                            |
#                            v

epoch   train_loss  valid_loss  mae time
0   0.156252    0.108844    0.295480    00:00
1   0.132855    0.075484    0.238252    00:00
2   0.126005    0.058170    0.203647    00:00
3   0.122865    0.048346    0.181954    00:00
4   0.119844    0.043026    0.169333    00:00
5   0.117942    0.039927    0.161866    00:00
6   0.116912    0.037847    0.156890    00:00
7   0.114023    0.036735    0.154284    00:00
8   0.112187    0.036117    0.152822    00:00
$\endgroup$

1 Answer 1

1
$\begingroup$

The extra output during training is not from the tsai package itself but from the underlying fastai package. Depending on what out you want to show/hide you can use a few different context managers. To hide just the table output you should be able to use the model.no_logging() context manager:

with fcst.no_logging():
    fcst.fit_one_cycle(25, 1e-3)

You can also use the model.no_bar() context manager to disable the progress bar shown.

$\endgroup$
1
  • $\begingroup$ That worked beautifully -- thank you! $\endgroup$ Jan 21, 2022 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.