<jupyter_start><jupyter_text>DL<jupyter_code>x_train, y_train, x_test, y_test = process_dfs(df_train, df_test)
x_train.shape, x_test.shape
tr_ds, val_ds = to_TDS(x_train, y_train), to_TDS(x_test, y_test)
db = create_databunch(tr_ds, val_ds, 32)<jupyter_output><empty_output><jupyter_text>Testing dims at input/output<jupyter_code>for tx, ty in db.train_dl:
    print(tx.shape, ty.shape)<jupyter_output>torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([32, 1, 720]) torch.Size([32])
torch.Size([23, 1, 720]) torch.Size([23])<jupyter_text>Inception Time<jupyter_code>model = create_inception(1, num_classes, kss=[9, 19, 29, 39], depth=4).cuda()
# model = create_inception_resnet(1, num_classes, kss=[39, 19, 9], conv_sizes=[128, 128, 256]).cuda()
model
model(tx).shape
learn_res = fastai.basic_train.Learner(db, 
                                       model, 
                                       loss_func = CrossEntropyFlat(), 
                                       metrics=[accuracy],
                                       wd=1e-2).mixup()
learn_res.lr_find(); learn_res.recorder.plot(suggestion=True)
p, t = learn_res.get_preds()
error_rate(p,t)
def get_cm(p, t): return confusion_matrix(t, p.softmax(dim=1).argmax(1))<jupyter_output><empty_output><jupyter_text>Confusion Matrix<jupyter_code>sns.heatmap(get_cm(p,t), cmap='inferno')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17657142857142857, 'fraction_numerical': 0.072, 'mean_word_length': 4.306060606060606, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '474713', 'license': 'Apache-2.0', 'n_tokens_mistral': 786, 'n_tokens_neox': 690, 'n_words': 114, 'path': 'v1/03_ChlorineConcentration.ipynb', 'repo_name': 'williamsdoug/timeseries_fastai', 'size': '1750'}