completed 2 clustering parts of unsupervised learning section

This commit is contained in:
2019-07-25 00:12:04 +01:00
parent 9648dfe7db
commit 15dfbd5d91
23 changed files with 5877 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cluster import KMeans
from IPython.display import Image
from sklearn.datasets.samples_generator import make_blobs
def check_q1(stuff):
a = 0
b = 60
c = 22.9
d = 4.53
e = 511.7
q1_dict = {
'number of missing values': a,
'the mean 5k time in minutes': c,
'the mean test score as a raw value': e,
'number of individuals in the dataset': b
}
if stuff == q1_dict:
print("That looks right!")
else:
print("Oops! That doesn't look quite right! Try again.")
def check_q5(stuff):
a = 'We should always use normalizing'
b = 'We should always scale our variables between 0 and 1.'
c = 'Variable scale will frequently influence your results, so it is important to standardize for all of these algorithms.'
d = 'Scaling will not change the results of your output.'
if stuff == c:
return Image(filename="./giphy.gif")
else:
print("Oops! That doesn't look quite right. Try again!")