Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: how to remove trackback on python when ctrl c 
Python :: python is not writing whole line 
Python :: per gjera te shumta. Python 
Python :: pyqt5 window size 
Python :: how to lock writing to a variable thread python 
Python :: python timestamp shift one day 
Python :: save plot in python 
Python :: colorama 
Python :: python test if number in string 
Python :: how to find determinant in numpy 
Python :: scroll to bottom in selenium python 
Python :: python logger format time 
Python :: orderd dictionary pop vs del 
Python :: array must not contain infs or NaNs 
Python :: convert a pandas column to int 
Python :: DataFrame.plot.line() method: | dataframe line plot 
Python :: pyqt5 message box 
Python :: matlab find in python 
Python :: urllib python 
Python :: join pyspark stackoverflow 
Python :: how to pronounce aesthetic 
Python :: how to know how much lines a file has using python 
Python :: python import stringio 
Python :: how plot graph by using group by function in python 
Python :: how to get 2 random inputs in a list using for loop 
Python :: confusion matrix from two columns pandas dataframe 
Python :: how to convert a list into string with  
Python :: create a dataframe with series 
Python :: how to remove data from mongo db python 
Python :: python calculate prime numbers until numer 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =