<jupyter_start><jupyter_text>Submission<jupyter_code>log_preds,y = learn.TTA(is_test=True)
probs = np.mean(np.exp(log_preds),0)
probs.shape
type(probs)
probs.argmax(1)
data.classes[11]
data.test_ds.fnames[0]
fnames  = []

for fname in data.test_ds.fnames:
    fnames.append(fname[5:])
#display first 5
fnames[0:5]
species = []
for prob in probs.argmax(1):
    species.append(data.classes[prob])
species[:5]
subm = dict(zip(fnames,species))
df = pd.DataFrame.from_dict(subm, 'index')
df.columns = ['species']
df.index.rename('file', inplace=True)
df.head()
SUBM = f'{PATH}/sub/'
os.makedirs(SUBM, exist_ok=True)
df.to_csv(f'{SUBM}subm.gz', compression='gzip')
FileLink(f'{SUBM}subm.gz')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18321678321678322, 'fraction_numerical': 0.015384615384615385, 'mean_word_length': 7.044943820224719, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '110181', 'license': 'Apache-2.0', 'n_tokens_mistral': 323, 'n_tokens_neox': 317, 'n_words': 43, 'path': 'courses/dl1/Kaggle Seedlings Challenge.ipynb', 'repo_name': 'ShaunSpinelli/fastaiec2', 'size': '715'}