Skip to content

Instantly share code, notes, and snippets.

@Olshansk
Created May 24, 2020 19:55
Show Gist options
  • Select an option

  • Save Olshansk/ed6f02eb98d5c3f3e9b1562960b110d7 to your computer and use it in GitHub Desktop.

Select an option

Save Olshansk/ed6f02eb98d5c3f3e9b1562960b110d7 to your computer and use it in GitHub Desktop.
Transition Matricies - Regression Analysis
# Regression Analysis
fig, ax = plt.subplots(2, 1, figsize=(20,20))
sns.set(color_codes=True)
print("r2_score: ", round(r2_score(grades_GT, grades_P), 2))
print("mean_squared_error: ", round(mean_squared_error(grades_GT, grades_P), 2))
print("mean_absolute_error: ", round(mean_absolute_error(grades_GT, grades_P), 2))
print("explained_variance_score: ", round(explained_variance_score(grades_GT, grades_P), 2))
ax[0].tick_params(axis='both', labelsize=25)
ax[0].set_title("Ground Truth & Predicted Grades - PDF")
ax[0].title.set_size(30)
sns.distplot(grades_GT, kde=True, rug=False, ax=ax[0])
sns.distplot(grades_P, kde=True, rug=False, ax=ax[0])
ax[1].tick_params(axis='both', labelsize=25)
ax[1].set_title("Ground Truth & Predicted Grades - Histogram")
ax[1].title.set_size(30)
sns.distplot(grades_GT, kde=False, rug=True, ax=ax[1])
sns.distplot(grades_P, kde=False, rug=True, ax=ax[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment