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
#Reference: http://scikit-learn.org/stable/auto_examples/neighbors/plot_classification.html#sphx-glr-auto-examples-neighbors-plot-classification-py | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.colors import ListedColormap | |
from sklearn import neighbors | |
# Set to 1 for 3a, set to 3 for 3b | |
n_neighbors = 3 |
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
#Reference: https://stackoverflow.com/questions/38511444/python-download-files-from-google-drive-using-url | |
import requests | |
def download_file_from_google_drive(id, destination): | |
URL = "https://docs.google.com/uc?export=download" | |
session = requests.Session() | |
response = session.get(URL, params = { 'id' : id }, stream = True) |
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
import numpy as np | |
from scipy.spatial import distance | |
m1 = [1, 3.1] | |
m2 = [1.5, 2.1] | |
m3 = [2, 2.2] | |
m4 = [3.1, 1.1] | |
all_m = [m1, m2, m3, m4] | |
all_m = np.array(all_m) |
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
import numpy as np | |
from scipy.spatial import distance | |
m1 = [1, 3.1] | |
m2 = [1.5, 2.1] | |
m3 = [2, 2.2] | |
m4 = [3.1, 1.1] | |
all_m = [m1, m2, m3, m4] | |
all_m = np.array(all_m) | |
a = 0.3 |