Closed gitusrnm closed 1 year ago
Hi @gitusrnm, I'm sorry for the late reply. I've fixed an issue that impacted MultiLabel tasks. I've run this code and it works well:
from tsai.all import *
dsid = 'ECG5000'
X, y, splits = get_UCR_data(dsid, split_data=False)
class_map = {
'1':['Nor'], # N:1 - Normal
'2':['RoT', 'Pre'], # r:2 - R-on-T premature ventricular contraction
'3':['PVC', 'Pre'] , # V:3 - Premature ventricular contraction
'4':['SPC', 'Pre'], # S:4 - Supraventricular premature or ectopic beat (atrial or nodal)
'5':['Unk'], # Q:5 - Unclassifiable beat
}
labeler = ReLabeler(class_map)
y_multi = labeler(y)
tfms = [None, TSMultiLabelClassification()] # TSMultiLabelClassification() == [MultiCategorize(), OneHotEncode()]
batch_tfms = [TSStandardize()]
dls = get_ts_dls(X, y_multi, splits=splits, tfms=tfms, batch_tfms=batch_tfms, bs=[64, 128])
learn = ts_learner(dls, InceptionTimePlus, loss_func=BCEWithLogitsLossFlat(), cbs=[ShowGraph()])
learn.fit_one_cycle(1, lr_max=1e-3)
I checked it out, and it works for me now.
Many thanks @oguiza for creating and supporting such a great library!!!
Hi and thanks for the great library!
I have some issues with multi-label classification. I used it with my dataset and the training was successful. But I got an error at inference.
I tried it with one sample:
pred = learn.get_X_preds(X = NP.array([X[splits[1]][0]]), bs = 1)
and got:
I started looking for the problem, and ended up trying to rerun the code from 01a_MultiClass_MultiLabel_TSClassification.ipynb :
and got an error:
My computer_setup():