Data Science - Jupyter Notebooks
Details
The purpose of this assignment is expose you to a (second) polynomial regression problem. Your goal is to:
Below is the first figure you must emulate:
Below is the second figure you must emulate:
Each of the two figures has four subplots. Note the various viewing angles that each subplot presents - you can achieve this with the view_init() method. Use the same color scheme for the datapoints shown here, which is called jet. Be sure to label your axes as shown.
# Common imports
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import cm
import numpy as np
import pandas as pd
import os
%matplotlib inline
mpl.rc('axes', labelsize=14)
mpl.rc('xtick', labelsize=12)
mpl.rc('ytick', labelsize=12)
# Where to save the figures
PROJECT_ROOT_DIR = "."
FOLDER = "figures"
IMAGES_PATH = os.path.join(PROJECT_ROOT_DIR, FOLDER)
os.makedirs(IMAGES_PATH, exist_ok=True)
def save_fig(fig_id, tight_layout=True, fig_extension="png",
resolution=300):
path = os.path.join(IMAGES_PATH, fig_id + "." +
fig_extension)
print("Saving figure", fig_id)
if tight_layout:
plt.tight_layout()
plt.savefig(path, format=fig_extension,
dpi=resolution)