Last active
March 17, 2018 13:26
-
-
Save ababycat/c4e4110e9e02a6d6adb99e377453f789 to your computer and use it in GitHub Desktop.
show f1 score use matplotlib in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
def f1_score(precision, recall): | |
return precision*recall/(precision+recall) | |
x = np.arange(1e-3, 1, 1e-3) | |
y = np.arange(1e-3, 1, 1e-3) | |
X, Y = np.meshgrid(x, y) | |
Z = f1_score(X, Y) | |
fig = plt.figure() | |
ax = Axes3D(fig) | |
ax.plot_surface(X, Y, Z) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment