Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVC
from sklearn.naive_bayes import GaussianNB
from sklearn import neighbors
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
lr = LinearRegression(normalize=True)
lr.fit(x_train, y_train)
knn = neighbors.KNeighborsClassifier(n_neighbors=5)
knn.fit(x_train, y_train)
svc = SVC(kernel='linear')
svc.fit(x_train, y_train)
k_means = KMeans(n_clusters=3, random_state=0)
k_means.fit(x_train)
pca = PCA(n_components=0.95)
pca.fit_transform(x_train)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment