Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created April 3, 2021 06:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save amankharwal/e06b80a147b0f2ae17b498a839ae3dcf to your computer and use it in GitHub Desktop.
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