Skip to main content

Posts

The most powerful kernel trick of SVM

 The kernel trick is most important and powerful technique of SVM . Linear VS Non-Linear dataset linear vs non-linear figure Problem Statement Currently we have learn how to apply SVM algorithm at linear datasets, but what if we have non linear dataset. Solution of Problem Solution is kernel trick. Kernel Trick The Kernel trick is trick where we add  many SVMS  models by bagging,voting,stacking and boosting or we can use SVM class to implement it. Implementation To implement it follow code given below- from sklearn.svm import SVC svc=SVC() svc.fit(X_train,y_train) svc.score(X_test,y_test)

SVM Intuition

SVM Intuition SVM(Support Vector Machine) is knows as family of linear models but it is really good than linear models it can draw line also and work as well in non-linear dataset also NOTE-Linear models<SVM always this is not true remember The target of LinearSVM classifier is to maximize margin

Voting Regressor

 Voting Regressor In previous class we discuss about the voting classifier.Today we use voting with regression.Let's start todays class Model: 1. Linear Regression 2. Support vector machine 3. Random forest New point - X=0.987,y=? How our voting regressor predict value? Linear Regression says 15.7 SVM says 12.9 Random forest says 8 Voting Regressor take mean of all model outputs which is 31.2 It means new point X=0.987 and y=31.2

Voting Classifier

Voting Classifier In voting classifier we select some models.Suppose you select Logistic Regression,SVM,KNN Always remember no.of models you select will always odd because we use majority count Suppose a new data point cames and Outputs are 1.Logististic Regression->1 2.SVM->0 3.KNN->1 Here you can see no.of model said 1(2)>no.of model said 0(1)-.So ours model says 1 Here you can also use this logic in multiclass classification