import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

%matplotlib inline

"""
Explanation: Homework 1
Due Wednesday, September 2 by 2:00 PM. Submit via email.
Some helpful setup code. Feel free to add whatever else you might need.
End of explanation
"""


# Code here

"""
Explanation: Question 1
Pick a graph from Spurious Correlations and recreate it using
matplotlib, numpy and pandas. For whichever graph you choose, save the data in one or more CSV files and submit them with your assignment. Make sure your axes are labeled propertly.
End of explanation
"""


from sklearn.datasets import load_iris
iris_dataset = load_iris()
features = iris_dataset.feature_names
data = iris_dataset.data
targets = iris_dataset.target

df = pd.DataFrame(data, columns=features)
pd.plotting.scatter_matrix(df, c=targets, figsize=(15,15),
                          marker='o', hist_kwds={'bins': 20}, s=60,
                          alpha=.8);

"""
Explanation: Question 2
Scikit-learn includes many datasets for playing with, one of which is iris. This dataset includes measures of many iris flowers, measured in centimeters: sepal length, sepal width, petal length, and petal width. (The sepal is just another part of the flower.) The dataset also includes the species of each flower measured (setosa, versicolor, or virginica).
Often when we start with a new dataset we can to explore it visually to get a feel for it. Pandas provides us with a very quick and easy way to compare all the measurements to each other (A similar figure (and similar code) appears on page 20 of IMLP):
End of explanation
"""


# Code here

"""
Explanation: Create a pair-plot of the iris dataset similar to this figure using only numpy and
matplotlib (you can use scikit-learn to load the data with sklearn.datasets.load_iris, you are not
allowed to use pandas). Ensure all axes are labeled. The diagonals need to contain histograms,
the different species need to be distinguished by color or glyph, and there needs to be a
legend for the species.
End of explanation
"""


# Code here

"""
Explanation: Question 3
Create an array of scatter plots on the boston housing dataset
(sklearn.datasets.load_boston). This dataset contains 13 housing-related features of areas in Boston e.g., crime rate), along with a "target" value of median value of owner-occupied homes (MEDV). After loading the dataset, try print(boston_dataset.DESCR) for more info.
For each feature, plot this feature against the target MEDV. Use
alpha to cope with overplotting. Ensure everything is labeled properly and the resulting charts can
easily be read and understood.
End of explanation
"""


