from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
import numpy as np
#example data for X and y
y = np.random.randint(0,2,1000)
X = np.random.rand(y.size, 3)
#common practice to normalize X so no variable is carrying more weight in loss calculation
scaler = StandardScaler()
scaler.fit(X)
X_scaled = scaler.transform(X)
#linear kernel yields a linear function
model = SVC(kernel = 'linear')
model.fit(X_scaled, y)
print(model.coef_)
print(model.intercept_)
#rbf yields a gaussian function
model = SVC(kernel = 'rbf')
model.fit(X_scaled, y)
#use the model to predict new data
X_pred = np.random.rand(10, 3)
X_pred = scaler.transform(X_pred)
y_pred = model.predict(X_pred)
print(y_pred)