Created
August 13, 2018 22:02
-
-
Save FisherKK/55e4a1d52df1951fdb2ba4a7ba89ffa2 to your computer and use it in GitHub Desktop.
This file contains 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
matplotlib.rcParams.update({'font.size': 14}) | |
plt.figure(figsize=(8, 5)) | |
plt.scatter(df_data["size"], df_data["price"], | |
edgecolor='black', linewidth='1', s=70, alpha=0.7, c="#3176f7") | |
plt.plot(np.arange(0, 120, 0.1), [predict([x], model_parameters) for x in np.arange(0, 120, 0.1)], c="red") | |
plt.text(90, 700, "y = 7.1x + 10", color="r", fontsize=14, rotation=25) | |
plt.xlabel("Size [m^2]") | |
plt.ylabel("Price [k zł]") | |
plt.ylim(-100, 1000) | |
plt.xlim(0, 120) | |
plt.title("y = wx + b, [w={:.1f}, b={:.1f}]".format(model_parameters["w"][0], model_parameters["b"])) | |
plt.yticks(np.arange(0, 1000, 100)) | |
plt.xticks(np.arange(0, 120, 10)) | |
plt.grid(color='blue', linestyle='--', linewidth=1, alpha=0.2) | |
plt.gca().spines["top"].set_visible(False) | |
plt.gca().spines["right"].set_visible(False) | |
plt.gca().spines["bottom"].set_visible(False) | |
plt.gca().spines["left"].set_visible(False); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment