<jupyter_start><jupyter_text>Data Injestion<jupyter_code>games_df = pd.read_csv("games.csv")
attendance_df = pd.read_csv("attendance.csv")
standings_df = pd.read_csv("standings.csv")<jupyter_output><empty_output><jupyter_text>Superbowl EDA<jupyter_code>standings_df["won_superbowl"] = standings_df.apply(lambda row: row["sb_winner"] == "Won Superbowl", axis=1)
superbowl_winners_df = standings_df.loc[standings_df["sb_winner"] == "Won Superbowl"]<jupyter_output><empty_output><jupyter_text>Q: How many wins did each team get in the data set?<jupyter_code>def bar_plot_one_column(df, column_name):
    g = sns.catplot(kind="bar", x="team", y=column_name, height=15, data=df)
    plt.xticks(rotation=45)
bar_plot_one_column(standings_df.groupby(["team"]).sum().reset_index().sort_values(by="won_superbowl", ascending=False), "won_superbowl")
bar_plot_one_column(standings_df.groupby(["team"]).sum().reset_index().sort_values(by="wins", ascending=False), "wins")
bar_plot_one_column(standings_df.groupby(["team"]).sum().reset_index().sort_values(by="wins", ascending=False), "points_for")<jupyter_output><empty_output><jupyter_text>Quick Model<jupyter_code>standings_df
X=standings_df[["wins", "loss", "points_for", "points_against", "margin_of_victory"]]
y=standings_df["won_superbowl"]

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0)

logreg = LogisticRegression()
logreg.fit(X_train, y_train)


y_pred = logreg.predict(X_test)
print('Accuracy of logistic regression classifier on test set: {:.2f}'.format(logreg.score(X_test, y_test)))
print("F1 score of logisitc regression clasifier on test set: {:.2f}".format(f1_score(y_test, y_pred)))
y_test
y_pred
worst_winner_df = standings_df.groupby(["year", "team"]).sum().sort_values(by="points_for")
worst_winner_df.loc[worst_winner_df["won_superbowl"] == True]

# superbowl_winners_df = standings_df.loc[standings_df["sb_winner"] == "Won Superbowl"]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15802845528455284, 'fraction_numerical': 0.006097560975609756, 'mean_word_length': 11.00609756097561, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '374496', 'license': 'CC0-1.0', 'n_tokens_mistral': 796, 'n_tokens_neox': 780, 'n_words': 100, 'path': 'data/2020/2020-02-04/Untitled.ipynb', 'repo_name': 'GregHilston/tidytuesday', 'size': '1968'}