<jupyter_start><jupyter_text>Plot accuracies  Create a df to plot loss values<jupyter_code># Initialize an empty df
final = pd.DataFrame()
# List the columns the df will have
final_columns = ['Train Acc With', 'Train Acc Without', 'Train Loss With', 'Train Loss Without', 'Test Acc With', 'Test Acc Without']
# Create the columns
for column in final_columns:
    final[column] = None
# Confirm they were correctly created
final
# Add training accuracy values
final['Train Acc With'] = withw['train_acc_with_weights']
final['Train Acc Without'] = withoutw['train_acc_without_weights']

# Add loss values
final['Train Loss With'] = withw['loss_with_weights']
final['Train Loss Without'] = withoutw['train_loss_without_weights']

# Add val accuracy values
final['Test Acc With'] = withw['test_acc_with_weights']
final['Test Acc Without'] = withoutw['test_acc_without_weights']
final.head(5)
# define area
plt.figure(figsize=(10, 5))

# define x axis
x = final.index
  
# plot lines train acc
plt.plot(x, final['Train Acc With'], label = "Train Acc With Weights", color='red')
plt.plot(x, final['Train Acc Without'], label = "Train Acc Without Weights", color='blue')

# plot lines train loss
#plt.plot(x, final['Train Loss With'], label = "Train Loss With Weights", color='red', linestyle='-.')
#plt.plot(x, final['Train Loss Without'], label = "Train Loss Without Weights", color='blue', linestyle='-.')

# plot lines test acc
plt.plot(x, final['Test Acc With'], label = "Test Acc With Weights", color='red', linestyle='-.')
plt.plot(x, final['Test Acc Without'], label = "Test Acc Without Weights", color='blue', linestyle='-.')

plt.xticks(np.arange(0, 30, 1))
plt.yticks(np.arange(0, 1.1, 0.1))
plt.legend()
plt.xlabel("Epochs")
plt.ylabel("Train and Test Accuracies")
plt.title("Comparing Models With and Without Class Weights - Accuracy")
plt.show()<jupyter_output><empty_output><jupyter_text>Plot loss values  Create a df to plot loss values<jupyter_code># Initialize an empty df
final_loss = pd.DataFrame()
# List the columns the df will have
final_loss_columns = ['Train Loss Lower', 'Train Loss IN', 'Val Loss Lower', 'Val Loss IN']
# Create the columns
for column in final_loss_columns:
    final_loss[column] = None
# Confirm they were correctly created
final_loss
# Add training accuracy values
final_loss['Train Loss Lower'] = lower['loss']
final_loss['Train Loss IN'] = i_norma['loss']

# Add val accuracy values
final_loss['Val Loss Lower'] = lower['val_loss']
final_loss['Val Loss IN'] = i_norma['val_loss']
final_loss.head(5)<jupyter_output><empty_output><jupyter_text>Plot<jupyter_code># define area
plt.figure(figsize=(10, 5))

# define x axis
x = final_loss.index
  
# plot lines
plt.plot(x, final_loss['Train Loss Lower'], label = "Train Loss Without Image Norm", color='green')
plt.plot(x, final_loss['Train Loss IN'], label = "Train Loss With Image Norm", color='red')

plt.plot(x, final_loss['Val Loss Lower'], label = "Val Loss Without Image Norm", color='green', linestyle='-.')
plt.plot(x, final_loss['Val Loss IN'], label = "Val Loss With Image Norm", color='red', linestyle='-.')

plt.xticks(np.arange(0, 25, 1))
plt.legend()
plt.xlabel("Epochs")
plt.ylabel("Train and Val Loss")
plt.title("Comparing Models With and Without Image Normalization - Loss")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14423366455886782, 'fraction_numerical': 0.006323396567299007, 'mean_word_length': 6.038135593220339, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '478917', 'license': 'MIT', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1061, 'n_words': 348, 'path': 'Training histories, saved models, confusion matrices/Final Files/02 All Data/09 With and Withou Weights/With and without image weights.ipynb', 'repo_name': 'ph1001/Deep_Learning_Project_Group_10', 'size': '3321'}