tsai icon indicating copy to clipboard operation
tsai copied to clipboard

time series classification question

Open ChaohuanDeng123 opened this issue 8 months ago • 1 comments

For time series classification tasks, if there is an imbalance in the data among categories, such as three categories where one category greatly outnumbers the others, how should I handle it? For example, by modifying the loss function to assign different weights to different categories. How should I modify the following code? model = TST(dls.vars, dls.c, dls.len, dropout=.3, fc_dropout=.8).to(device) learn = Learner(dls, model, loss_func=LabelSmoothingCrossEntropyFlat(),metrics=[accuracy], cbs=ShowGraphCallback2()) start = time.time() learn.fit_one_cycle(50, lr_max=1e-4) print('\nElapsed time:', time.time() - start) learn.plot_metrics()

ChaohuanDeng123 avatar Jun 22 '24 11:06 ChaohuanDeng123