Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Filler values must be provided when X has more than 2 training features

from sklearn.decomposition import PCA
from mlxtend.plotting import plot_decision_regions

clf = SVC(C=100,gamma=0.0001)
pca = PCA(n_components = 2)
X_train = pca.fit_transform(X_train)
clf.fit(X_train, y_train)
plot_decision_regions(X_train, y_train, clf=clf, legend=2)

plt.xlabel(X.columns[0], size=14)
plt.ylabel(X.columns[1], size=14)
plt.title('SVM Decision Region Boundary', size=16)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Filler #values #X #training #features
ADD COMMENT
Topic
Name
5+8 =