<jupyter_start><jupyter_text>IntroductionThis notebook predicts the `beer_style` using a neural network on the PyTorchframework.<jupyter_code>project_dir = Path(find_dotenv()).parent
data_dir = project_dir / 'data'
raw_data_dir = data_dir / 'raw'
interim_data_dir = data_dir / 'interim'
processed_data_dir = data_dir / 'processed'
report_dir = project_dir / 'reports'
X_train, x_test, y_train, y_test = load_sets()<jupyter_output><empty_output><jupyter_text>Baseline model<jupyter_code>null = NullModel(target_type = 'classification')
preds = null.fit_predict(y_train)
ohe = OneHotEncoder()
y_train_ohe = ohe.fit_transform(y_train.to_frame())
y_train_ohe.toarray()
ovo = roc_auc_score(y_train_ohe.toarray(), preds.toarray(), multi_class='ovo')
# ovr = roc_auc_score(y_train, preds, multi_class='ovr')
print(f'ovo: {ovo}')
# print(f'ovr: {ovr}')
ovr = roc_auc_score(y_train_ohe.toarray(), preds.toarray(), multi_class='ovr')
print(f'ovr: {ovr}')
accuracy_score = accuracy_score(y_train_ohe, preds)
accuracy_score<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1335254562920269, 'fraction_numerical': 0.0, 'mean_word_length': 9.116504854368932, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '250890', 'license': 'MIT', 'n_tokens_mistral': 416, 'n_tokens_neox': 409, 'n_words': 65, 'path': 'notebooks/1_null.ipynb', 'repo_name': 'roger-yu-ds/assignment_2', 'size': '1041'}