Skip to content

Instantly share code, notes, and snippets.

@kyleziegler
Last active March 18, 2022 17:34
Show Gist options
  • Save kyleziegler/2b68ffb3a49f347f0b626486c3506c18 to your computer and use it in GitHub Desktop.
Save kyleziegler/2b68ffb3a49f347f0b626486c3506c18 to your computer and use it in GitHub Desktop.
# Dataprep
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_wine
import numpy as np
import pandas as pd
import warnings
# silence warnings for parameter options we have already tried, useful when iterating
warnings.filterwarnings("ignore")
d = load_wine()
X, y = d.data, d.target
# X = X[:, np.newaxis, 2]
# X = np.array(X.iloc[:, 0]).reshape(-1, 1)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.20, random_state=0
)
print(X_train[:1])
print(y_train[:1])
import matplotlib.pyplot as plt
def plot(x,y, title="Scores over n iterations"):
plt.plot(x,y)
plt.ylabel('Mean Test Score')
plt.title(title)
plt.grid(True)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment