Support Vector Machine (SVM) with R - Classification and Prediction Example

  Рет қаралды 84,409

Dr. Bharatendra Rai

Dr. Bharatendra Rai

Күн бұрын

Includes an example with,
brief definition of what is svm?
svm classification model
svm classification plot
interpretation
tuning or hyperparameter optimization
best model selection
confusion matrix
misclassification rate
Machine Learning videos: goo.gl/WHHqWP
Becoming Data Scientist: goo.gl/JWyyQc
Introductory R Videos: goo.gl/NZ55SJ
Deep Learning with TensorFlow: goo.gl/5VtSuC
Image Analysis & Classification: goo.gl/Md3fMi
Text mining: goo.gl/7FJGmd
Data Visualization: goo.gl/Q7Q2A8
Playlist: goo.gl/iwbhnE
svm is an important machine learning tool related to analyzing big data or working in data science field.
R is a free software environment for statistical computing and graphics, and is widely used by both academia and industry. R software works on both Windows and Mac-OS. It was ranked no. 1 in a KDnuggets poll on top languages for analytics, data mining, and data science. RStudio is a user friendly environment for R that has become popular.

Пікірлер: 244
@flamboyantperson5936
@flamboyantperson5936 6 жыл бұрын
Sir will you please explain me what does Cost, gamma and radial means and what they do? Also explain me Radial and Sigmoid. I'm sorry too many questions I have asked but since you always help me to understand the concept clearly it's my request. Thank you Sir.
@williamlouis5883
@williamlouis5883 4 жыл бұрын
#Learning From "Support Vector Machine (SVM) with R-Classification and Prediction Example #准备工作,加载数据,并看一下数据的分布 data("iris") str(iris) library(ggplot2) qplot(Petal.Length, Petal.Width, data=iris, color=Species) #第一步:运行SVM,选择合适的Kernel方法 library(e1071) mymodel=svm(Species~., data=iris, kernel = "polynomial") #-------将mymodel的Kernel方法改为radial,linear,也可以改为polynomial summary(mymodel) #第二步:Tuning,即超平面优化,选择最佳模型 set.seed(123) tmodel=tune(svm, Species~., data = iris, ranges = list(epsilon = seq(0,1,0.1), cost = 2^(2:9))) #-------seq生成一个序列,0开始,1结束,中间相隔0.1,一共11位数; #-------cost取值为2到9,一共8位数,11x8=88个参数模型,如果数据很大,则需要很久 plot(tmodel) summary(tmodel) #第三步:选择最佳的模型,并作图 mymodel=tmodel$best.model summary(mymodel) plot(mymodel, data = iris, Petal.Width~Petal.Length, slice = list(Sepal.Width = 3, Sepal.Length = 4)) ##Petal.Width~Petal.Length,定义谁是X,谁是Y #第四步:计算预测能力 ##Confusion Matrix and MisClassification Error pred=predict(mymodel, iris) tab = table(Predicted = pred, Actual = iris$Species) tab #tab用来查看预测的结果 1-sum(diag(tab))/sum(tab) #计算预测失败的概率
@bkrai
@bkrai 4 жыл бұрын
Not sure about your question.
@williamlouis5883
@williamlouis5883 4 жыл бұрын
@@bkrai Thanks. It's the R code for this video.
@AnalyticsMaster
@AnalyticsMaster 7 жыл бұрын
Thumbs up !! most of your tutorials are pretty useful. you have a good knack of explaining complicated techniques in a simplified way.
@bkrai
@bkrai 7 жыл бұрын
Thanks for the feedback!
@abiani007
@abiani007 3 жыл бұрын
hello sir, can you provide some sources for SVR code for regression in Matlab as I want to optimize the hyperparameters using meta-heuristic algorithms
@bkrai
@bkrai 3 жыл бұрын
Unfortunately I don't use matlab.
@ShubhamKumar-xy6kj
@ShubhamKumar-xy6kj 4 жыл бұрын
Sir,as kernel changes number of support vector change.Can this number be measure of accuracy of the model?
@bkrai
@bkrai 4 жыл бұрын
For accuracy you should use info in the confusion matrix.
@shalinikumari-gk3ls
@shalinikumari-gk3ls Жыл бұрын
Sir your teaching is excellent please post some videos on how handle semi supervised machine learning algorithm in R especially in case of SVM
@bkrai
@bkrai Жыл бұрын
Thanks for the suggestion!
@kassemdia5932
@kassemdia5932 4 жыл бұрын
So you only used the Petal length and width to do the svm test and ignored the Spetal characteristics ? Or did they affect the algorithm ?
@bkrai
@bkrai 3 жыл бұрын
The others can be tried in the same way.
@supratikg1
@supratikg1 Ай бұрын
Hi Sir, I wrote a few articles and those are saying SVC is for binary classification, if we need to analyse a multiclass classification, we have to use eith OneVSOne or OneVsRest method, but in this video I can see, you haven't selected any one of them, is this library take care this matter by itself?? can you please explain this....regards
@bkrai
@bkrai Ай бұрын
You can refer to the documentation provided for the library for more details about multiclass-classification approach used: cran.r-project.org/web/packages/e1071/e1071.pdf
@supratikghosh2975
@supratikghosh2975 Ай бұрын
Thank you sir
@ajantaakhuly5237
@ajantaakhuly5237 3 жыл бұрын
Every time I try to plot after running the SVM model > plot(SVM Model name, data = data file name, Y axis variable~X axis variable) I get this error: > Error in Summary.factor(c(26L, 20L, 50L, 29L, 33L, 43L, 29L, 9L, 3L, 10L, : ‘min’ not meaningful for factors How do I correct this error?
@bkrai
@bkrai 3 жыл бұрын
Instead of factor, use a numeric variable.
@ajantaakhuly5237
@ajantaakhuly5237 3 жыл бұрын
@@bkrai But Dependent variable is binary , so I have to say factor, isnt it? Even in your video, species is factor.
@zhangting1446
@zhangting1446 6 жыл бұрын
Thank you so much for your wonderful videos! There is one question about this video, that is , when using the function "tune", it always says that "Error in if (tunecontrol$cross > n) stop(sQuote("cross"), " must not exceed sampling size!") : argument is of length zero" Have searched for solutions and tried to convert the data used to a list but still did not work. Would you please suggest how to fix it? Thank you!
@bkrai
@bkrai 4 жыл бұрын
I saw this today, probably by now you must have addressed this.
@divyasree3261
@divyasree3261 4 жыл бұрын
My data is qualitative it contains all variables are categorical...is svm applicable to my data??
@bkrai
@bkrai 4 жыл бұрын
Try random forest.
@jasonyao3762
@jasonyao3762 3 жыл бұрын
Many thanks sir,thank you!I have a question for you. In the following statement: "mymodel
@bkrai
@bkrai 3 жыл бұрын
It's because of 2D plot only 2 variables can be accommodated.
@jasonyao3762
@jasonyao3762 3 жыл бұрын
@@bkrai Thanks for the answer
@dr.bheemsainik4316
@dr.bheemsainik4316 3 жыл бұрын
@@bkrai Sir, you have assigned constant values for other variables. how you have decided those constant values sir?
@Didanihaaaa
@Didanihaaaa 6 жыл бұрын
Hello. Thanks for your videos. I was wondering that could you teach us about genetic programming in R if there is any? Thanks
@bkrai
@bkrai 6 жыл бұрын
Thanks for the suggestion, I;ve added this to my list.
@tmitra001
@tmitra001 3 жыл бұрын
I did this tuned_model
@raniash3ban383
@raniash3ban383 6 жыл бұрын
very wonderful and useful i have a problem in install package in R can you help me the problem is [ unable to install packages (default library 'c:/program files/r/r-3.4.3/library' is not writeable)]
@bkrai
@bkrai 6 жыл бұрын
probably you can restart RStudio and retry installing the package.
@raniash3ban383
@raniash3ban383 6 жыл бұрын
thanks
@chinois2100
@chinois2100 3 жыл бұрын
Hi why are you doing the typical training and test data in this case?
@bkrai
@bkrai 3 жыл бұрын
That can be easily done here too.
@poojamahesh8594
@poojamahesh8594 3 жыл бұрын
on tuning im getting this error..please help sir...Error in do.call(method, c(list(train.x, data = data, subset = train.ind[[sample]]), : 'what' must be a function or character string >
@kabeeradebayo9014
@kabeeradebayo9014 7 жыл бұрын
Thank you again for these complete episodes. You have been of a great help to me "Rai". Please, I'd appreciate a complete episode on the ensembles, essentially, heterogeneous ensemble using DT, SVM etc. inclusive as the base classifiers. Comprehensive videos on ensembles are not common, in fact, I haven't come across any. It will go a long way If you could put something together on this. Thank you for your help!
@bkrai
@bkrai 7 жыл бұрын
Thanks for the suggestion, I'll do it in near future!
@dr.bheemsainik4316
@dr.bheemsainik4316 3 жыл бұрын
Sir, may i know why sepal length and sepal width assigned with constant values. that means we can't plot model with more than 2 variables. if I have assign constant values, how to decide the constant values like you have assigned 3 and 4. suppose I have used boruta algorithm for variables selection before running SVM model. i got 5 variables out of 10 variables as important. then how to plot SVM model. please help me by replying to my comment
@machinelearningzone.6230
@machinelearningzone.6230 4 жыл бұрын
Hi sir, Can you please explain the significance of the parameters epsilon! Regards
@bkrai
@bkrai 4 жыл бұрын
It affects the number of support vectors.
@shivibhatia1613
@shivibhatia1613 6 жыл бұрын
The most abused and waste data set to do any analysis on this IRIS dataset. Does not serve any purpose. Take 100 odd variables with 50k obs and then upload a video.
@bkrai
@bkrai 6 жыл бұрын
Thanks for the suggestion!
@akd9977
@akd9977 6 жыл бұрын
Dear Shivi, SVM will work only on few observations, prob 1000 records. For high no of dataset, this is not the suitable technique
@jesusb9562
@jesusb9562 Жыл бұрын
Why when you used the slice function you set Sepal.Width = 3 and Sepal.Length = 4 ? Is this just for convenience since they are the last two variables that need to be accounted for? Are these the boundaries that are created when you created the graph?
@dr.remagopalan1667
@dr.remagopalan1667 7 жыл бұрын
Namaste Sir Your videos are useful and splendid demonstration of each techniques. Sir, Can we use SVM for responses collected on Likert scales 5 and 7. eagerly waiting for your reply and I would be happy if you can share your contact number. Regards Dr.Rema Gopalan
@bkrai
@bkrai 4 жыл бұрын
Sorry I saw this today. I would have suggested, should work fine.
@dr.divyasrivastava2820
@dr.divyasrivastava2820 7 жыл бұрын
tab
@bkrai
@bkrai 4 жыл бұрын
Make sure pred and actual have same number of data points.
@sanjibphukan8921
@sanjibphukan8921 2 жыл бұрын
Nicely explain. Sir, can you please make a video on the ROC of the SVM model. Can you please share your email id?
@bkrai
@bkrai 2 жыл бұрын
Thanks! For ROC you can refer to this: kzbin.info/www/bejne/nKXNf6iGoLWEeJY my email seemabharat@gmail.com
@sanjibphukan8921
@sanjibphukan8921 2 жыл бұрын
@@bkrai kindly check the email, sir.
@bkrai
@bkrai 2 жыл бұрын
saw your email. As mentioned earlier, try: kzbin.info/www/bejne/nKXNf6iGoLWEeJY
@sanjibphukan8921
@sanjibphukan8921 2 жыл бұрын
@@bkrai i tried. But the ROC of the SVM model is not appear as the ROC of LR. Can we predict the probability values of SVM as we did in LR
@andresbaron8557
@andresbaron8557 4 жыл бұрын
Okay , if i got the model ... how can i do to get an equation to for example use it in an application ? i mean to reproduce the classification results without R ? Thank you
@Didanihaaaa
@Didanihaaaa 6 жыл бұрын
Hello Dr. Rai, Thanks for your great tutorials. I shoud say I learnt ML and r coding using your tutorial much more than udemy, lynda, and other works. Good Job. Your channel is the best indeed! I suggested to all my frineds! I was wondering that would you teach us some machine learning in python?
@bkrai
@bkrai 6 жыл бұрын
Thanks for your comments! I'll plan to do python in few months.
@sojibulislam1004
@sojibulislam1004 2 жыл бұрын
Dear Sir, Thank u very much for the video and code. I can say I learned ML and r coding using your tutorial much more than udemy, lynda, and other works. Good Job. Your channel is the best indeed!
@bkrai
@bkrai 2 жыл бұрын
You are most welcome!
@kabeeradebayo9014
@kabeeradebayo9014 7 жыл бұрын
Thank you for your made simple and easy to follow video tutorials. You are awesome!
@bkrai
@bkrai 7 жыл бұрын
Thanks for your feedback!
@nimishapapineni2216
@nimishapapineni2216 4 жыл бұрын
Hello sir, in the 14 line from script (4.56 mins in vedio) we have slice, how to select the values in it and if many variables are the in the data, should we take SVM seperately between two variables each time?
@bkrai
@bkrai 4 жыл бұрын
This is what slice represents - "a list of named values for the dimensions held constant (only needed if more than two variables are used). The defaults for unspecified dimensions are 0 (for numeric variables) and the first level (for factors). Factor levels can either be specified as factors or character vectors of length 1." In the video we used values that are more reasonable than default zero.
@kalyanasundaramsp8267
@kalyanasundaramsp8267 6 жыл бұрын
super sir, here there is clear separation but "cleveland heart" from UCI is complex and have lot of overlapping...
@bkrai
@bkrai 6 жыл бұрын
That's right. And for data that have lot of overlapping, it is always a good idea to try more methods.
@delt19
@delt19 6 жыл бұрын
Your tutorials are priceless. Thank you for sharing your knowledge. This was easy to understand and to the point.
@bkrai
@bkrai 6 жыл бұрын
Thanks for comments!
@poornalya9605
@poornalya9605 3 жыл бұрын
Sir for large sample value what could be the value of epsilon and cost..
@ashraffashafsheh1785
@ashraffashafsheh1785 4 жыл бұрын
Thank you very much, please can you give me how to downsampling And oversampling the positive data samples to avoid data imbalance
@bkrai
@bkrai 4 жыл бұрын
Here is the link: kzbin.info/www/bejne/fqCVfJ-sr8-Ynck
@sandeepmane8694
@sandeepmane8694 3 жыл бұрын
Incredible explain sir....plz made a video list of parametric and non parametric test..as early as possible
@bkrai
@bkrai 3 жыл бұрын
Thanks for the suggestion!
@zhuziyan9454
@zhuziyan9454 6 жыл бұрын
god blesses you sir. You are the best and much appreciate!!!
@bkrai
@bkrai 6 жыл бұрын
Thanks for comments!
@ayushanand1250
@ayushanand1250 2 жыл бұрын
1. While ploting the model at 4:06, why did u choose "Petal.Width~Petal.Lenght"? Is it because these variables have low correlation? 2. Also what is the reason to select Sepal.Width = 3 and Sepal.Length = 4? Is it because while using these values we see a better classifier while plotting the model?
@omar13596
@omar13596 Жыл бұрын
I found this From ?plot.svm slice a list of named numeric values for the dimensions held constant (only needed if more than two variables are used). Dimensions not specified are fixed at 0. In other words, when visualising the effect of predictor variables on the response you can specify which other predictor variables are to be hold constant (i.e. at a fixed value). So in your example, you're visualising the effect of the predictor variables Petal.Length and Petal.Width on the response while keeping Sepal.Width and Sepal.Length constant at the specified values
@swamchem
@swamchem 7 жыл бұрын
Thanks for the wonderful session on SVM. I have a question regarding how did you choose value for epsilon , cost for the tuned model. If it is a trial and error method, I would like to know how did you end up getting that.
@bkrai
@bkrai 7 жыл бұрын
The best values are chosen by the model itself from the range that we provide.
@swamchem
@swamchem 7 жыл бұрын
yes I agree that sir. But how did you come up with this range. it looks like the optimal value is entirely depends on the range which we provide. is that right?.
@swamchem
@swamchem 7 жыл бұрын
Yes I agree sir. But how did you come up with that range. It looks like that the optimum value for cost & epsilon is entirely depends on range we provide. Is that right sir?.
@bkrai
@bkrai 7 жыл бұрын
For epsilon the range has to be between 0 and 1. So you can try 0.1 increments. If the plot suggests further fine-tuning, you can even try 0.05 or 0.01 increments. For cost default value is 1. And as mentioned in the video, you need to try very wide range and that's why we have used 2^2 etc. For most situation this approach will help you to get best values for these parameters. The idea is to have very wide range for both so that you don't miss the best values.
@swamchem
@swamchem 7 жыл бұрын
oh fine sir.
@shubhamtalware5233
@shubhamtalware5233 3 жыл бұрын
Sir your videos are excellent and very easy to understand...!! Can you please post a video on regression models using SVM and ANN? That would be a great help in understanding the differences in results and validation parameters observed by using same algorithms. Thank you.
@bkrai
@bkrai 3 жыл бұрын
For ANN, you can use: kzbin.info/www/bejne/iaO0qJKcjNRnotk
@shubhamtalware5233
@shubhamtalware5233 3 жыл бұрын
@@bkrai Yes sir... I had already went through that video but I wasn't able to perform that with my data. That's why I'm requesting you for the same.
@shuchismitagiri9257
@shuchismitagiri9257 2 жыл бұрын
Thank you sir for this video
@bkrai
@bkrai 2 жыл бұрын
Most welcome!
@kathytovar7112
@kathytovar7112 7 жыл бұрын
Hi! Excellent tutorial! all very clear.. I have a data set with four columns only, these are location, duration, date and time. I implemented the svm model for prediction, but all predicted values are incorrect. How can I approach date and time? I did normalize the data but still prediction rate is bad.
@bkrai
@bkrai 7 жыл бұрын
If one of the variables is date/time related, I would say use time series. Facebook recently open sourced its time series forecasting package. Here is the link: kzbin.info?o=U&video_id=7xDAYa6Ouo8
@kathytovar7112
@kathytovar7112 7 жыл бұрын
Hi! thank you, but the link is pointing to an empty page of youtube.
@bkrai
@bkrai 7 жыл бұрын
Here is the correct link: kzbin.info/www/bejne/bamncoyXa7SopZo
@ArpitSingh-dz7gt
@ArpitSingh-dz7gt 4 жыл бұрын
Sir what does slice =list (sepal. Width=3,sepal.length=4 ) indicates?
@bkrai
@bkrai 4 жыл бұрын
This is what slice represents - "a list of named values for the dimensions held constant (only needed if more than two variables are used). The defaults for unspecified dimensions are 0 (for numeric variables) and the first level (for factors). Factor levels can either be specified as factors or character vectors of length 1." In the video we used values that are more reasonable than default zero.
@tadessemelakuabegaz9615
@tadessemelakuabegaz9615 2 жыл бұрын
Thank you so much. A great explanation of the SVM model.
@bkrai
@bkrai 2 жыл бұрын
You are welcome!
@vjysri2756
@vjysri2756 4 жыл бұрын
Is there any way to extract varibale importance in SVM ?. If so could you please suggest how to do that. Thanks
@bkrai
@bkrai 4 жыл бұрын
You can try feature extraction using the link below before doing svm: kzbin.info/www/bejne/jHalkqtojLKVe6M
@vjysri2756
@vjysri2756 4 жыл бұрын
Dr. Bharatendra Rai Thanks.
@shapeletter
@shapeletter 4 жыл бұрын
Very nice video to watch during my exam preparations! The music would be nicer if it was maybe 50% of the volume at any point where you are talking. Otherwise well explained and great to watch :)
@bkrai
@bkrai 4 жыл бұрын
Thanks for the tip!
@shapeletter
@shapeletter 4 жыл бұрын
@@bkrai epsilon doesn't seem to have any effect of the results when I use tune like you do. But I found that another example used "gamma" instead of "epsilon" for another model and that had an effect on SVM for me (surprisingly). Do you know why it's like that?
@saikiran-fc8xc
@saikiran-fc8xc 4 жыл бұрын
SVM separate those factor levels like a cluster? If it is so why are having those many vectors?
@bkrai
@bkrai 4 жыл бұрын
It's outcome of the algorithm and depends on type of data.
@Sergei_B
@Sergei_B 6 жыл бұрын
Can you show us in other video how to do the support vector regreesion with a dataset with many variables? It will be great
@bkrai
@bkrai 6 жыл бұрын
thanks for the suggestion, I've added it to my list.
@rajthakkar9614
@rajthakkar9614 4 жыл бұрын
Very good content Sirji! Sir how to used the best model for testing data set ?
@bkrai
@bkrai 4 жыл бұрын
Instead of iris data with the model, you can use test data.
@rajthakkar9614
@rajthakkar9614 4 жыл бұрын
@@bkrai Thanks Sirji
@bkrai
@bkrai 4 жыл бұрын
welcome!
@thejuhulikal6290
@thejuhulikal6290 3 жыл бұрын
Thanks again, sir! please upload the R file sir.
@juancorderoromero6610
@juancorderoromero6610 3 жыл бұрын
Thank you Dr. Rai. This video was really helpful and entertaining.
@bkrai
@bkrai 3 жыл бұрын
You are welcome!
@kuirfan1085
@kuirfan1085 4 жыл бұрын
Very good explanation! Instantly subscribed to your channel.
@bkrai
@bkrai 4 жыл бұрын
Thanks for comments!
@marcoesteves4367
@marcoesteves4367 3 жыл бұрын
Dr, do you have any numeric svm (regression) tutorial?
@bkrai
@bkrai 3 жыл бұрын
Not yet.
@kalyanasundaramsp8267
@kalyanasundaramsp8267 6 жыл бұрын
brilliant, brilliant, brilliant sir.....request= can you do one please for regression
@bkrai
@bkrai 6 жыл бұрын
Thanks, I've added it to my list.
@kalyanasundaramsp8267
@kalyanasundaramsp8267 6 жыл бұрын
thankyou sir, can you please share the link
@bkrai
@bkrai 6 жыл бұрын
Here is the link: drive.google.com/open?id=0B5W8CO0Gb2GGc1ZZQWhmMmpuWWc
@yuefang1158
@yuefang1158 4 жыл бұрын
Hi, Rai thanks for this clear lecture. But I have a question: I follow the exactly same steps as yours, but when use tune function, I get a different result from you. I get the best parameter: cost 4 (instead of 8 as yours), the best performance 0.04 (instead of yours 0.033). But all the steps i just exactly the same with you. Do you have any idea why it happened?
@audreytetteh6956
@audreytetteh6956 5 жыл бұрын
is there anything i can do to get the size of every specie? i get the number of support vectors alright but it doesn't show the distribution... and also, i have 38 variables... how do i plot the graph for all of them?
@kalyanasundaramsp8267
@kalyanasundaramsp8267 6 жыл бұрын
Sir, for discrete independent variables, can we use them as factors model?
@bkrai
@bkrai 4 жыл бұрын
Yes, should work fine.
@BigBrother4Life
@BigBrother4Life 2 жыл бұрын
Why this was not divided into test/train?
@bkrai
@bkrai 2 жыл бұрын
Here just illustrated how to do SVM in R. But you are 100% correct, if you are applying it to any problem, make sure to split data in test/train.
@BigBrother4Life
@BigBrother4Life 2 жыл бұрын
@@bkrai thank you sir for your response. Also if you could answere, i tried this on pima indian diabetes dataset (very famous); except for sigmoid I coudn't see colored boundaries (+ve and -ve catagory) for any other function and the misclassification error is least for linear, yet the algorithm (your method to find out best function) says that radial is the best one, can you guess what could be happening under the hood?
@RamoSFTT
@RamoSFTT 6 жыл бұрын
I am an avid subscriber of yours. Your videos are simply outstanding and very helpful for self study. Thank you very much for your videos and all the hard work.
@bkrai
@bkrai 6 жыл бұрын
Thanks for feedback and comments!
@thetardheinrich
@thetardheinrich 7 жыл бұрын
Very clear and helpful. Thank you sir!
@bkrai
@bkrai 3 жыл бұрын
Welcome!
@asmam-k7150
@asmam-k7150 4 жыл бұрын
Hello sir! This was very helpful thank you so much.. Can you please tell me how to split the data into train and test because I didn't understand quite well how you split the data here.. Or if there is a link to w pervious tutorial.. Thank you so much
@bkrai
@bkrai 4 жыл бұрын
Here is a link that has more details: kzbin.info/aero/PL34t5iLfZddspfUiv-9EaOVNUG64_fwFq
@asmam-k7150
@asmam-k7150 4 жыл бұрын
Thank you 😁
@bkrai
@bkrai 4 жыл бұрын
welcome!
@FunTime-hq9ce
@FunTime-hq9ce 5 жыл бұрын
how qplot done if we more number of variable then what can I use qplot
@bkrai
@bkrai 5 жыл бұрын
In a scatter plot, we can only have two numeric variables at a time. If you have more variables, select two most important and see if they are helping to classify response or not.
@BalasubrahmanyamIra
@BalasubrahmanyamIra 5 жыл бұрын
I see that many videos say let us predict and use the predict command. What are you trying to predict? What is the output is being expected?
@bhavikdudhrejiya4478
@bhavikdudhrejiya4478 4 жыл бұрын
Very nice video. Easy to understand. Appreciated your effort.
@bkrai
@bkrai 4 жыл бұрын
Thanks for comments!
@mohamedgomaa2645
@mohamedgomaa2645 6 жыл бұрын
Many thanks again for your amazing video. Can you let me know how we evaluate the variables? Such as we have 10 variables but only 5 of them are significant (for ex; in logistic regression, we evaluate them by P-value and OR (95%CI)). Some said that we use weight to evaluate them, every variable has its weight, the higher the weight, the more signficant. And can you give me the code for that?
@jaydeepraut5374
@jaydeepraut5374 4 жыл бұрын
Sir I have one question. Why didn't you divide the data into train and test.
@bkrai
@bkrai 4 жыл бұрын
Since it was already a part of many videos, I try to focus just on SVM. But you are right, it's always better to partition the dataset.
@marces1009
@marces1009 4 жыл бұрын
Thanks for your video!! How to calculate AIC and BIC in SVM?
@jitendratrivedi7889
@jitendratrivedi7889 6 жыл бұрын
very informative and well explained.
@bkrai
@bkrai 6 жыл бұрын
Thanks for your comments!
@dennismontoro7312
@dennismontoro7312 5 жыл бұрын
Does SVM capture the nonlinear interaction effects across variables when using RBF?
@bkrai
@bkrai 5 жыл бұрын
That's correct.
@me3jab1
@me3jab1 5 жыл бұрын
good explanation
@bkrai
@bkrai 5 жыл бұрын
Thanks for comments!
@priyadipmanna4393
@priyadipmanna4393 5 жыл бұрын
graet video sir.. sir can u make a video on Taylors diagram.
@bkrai
@bkrai 5 жыл бұрын
Thanks for comments and suggestion!
@bugsysiegals
@bugsysiegals 6 жыл бұрын
Excellent video!! Thanks for sharing.
@bkrai
@bkrai 6 жыл бұрын
Thanks for comments!
@93divi
@93divi 7 жыл бұрын
Sir, I am unable to understand this line: slice = list(Sepal.Width = 3, Sepal.Length = 4)) What is the use and why 3 and 4?
@NAMHAIDORJ830
@NAMHAIDORJ830 7 жыл бұрын
hi how to work with high frequency data with SVM, thanks
@bkrai
@bkrai 4 жыл бұрын
From high frequency data you can extract features and then use svm.
@akkimalhotra26
@akkimalhotra26 7 жыл бұрын
Sir, I am getting the following error. could you say what can be done > plot(mymodel, data = iris, + Petal.Width~Petal.Length, + slice = list(Sepal.Width = 3, Sepal.length = 4)) Error in `[.data.frame`(expand.grid(lis), , labels(terms(x))) : undefined columns selected
@bkrai
@bkrai 7 жыл бұрын
I see a typo in Sepal.length = 4 use "L" in length.
@ravindarmadishetty736
@ravindarmadishetty736 7 жыл бұрын
Excellent Session sir on SVM...Very Useful
@bkrai
@bkrai 3 жыл бұрын
Thanks!
@adedayoadeyemi7671
@adedayoadeyemi7671 7 жыл бұрын
thank so much for this video sir....can i apply this to a Raster image (i.e., Array) and could you please share the R script as well sir
@bkrai
@bkrai 7 жыл бұрын
it depends on what type of data you have, no harm in trying. Here is the link to R code: drive.google.com/open?id=0B5W8CO0Gb2GGc1ZZQWhmMmpuWWc
@adedayoadeyemi7671
@adedayoadeyemi7671 7 жыл бұрын
Ok sir, thanks sir..... do u also have videos on KNN, Naive bayes and R codes for ROC, PCA and Multiple linear regression
@narayanareddy15
@narayanareddy15 4 жыл бұрын
@@bkrai thank you so much guru ji
@linkmetoo
@linkmetoo 6 жыл бұрын
Hi Bharatendra, I am trying to run SVM model on dataset with 15 features and the label is binary, it looks something like this y_test$SurveyYes
@bkrai
@bkrai 6 жыл бұрын
I would suggest try and use the same format as shown in the video.
@maheshmahi1593
@maheshmahi1593 6 жыл бұрын
Sir , can u explain the inutution for three classes what is going on, as u explained for the two classes..on e hyperplane is drawn between two classes ..if the third class is there how does it separate
@tejasavkhattar6617
@tejasavkhattar6617 6 жыл бұрын
Thankyou Sir, This tutorial was quite useful but I am trying to create a user-defined function for SVM analysis in which I can define the data set kernel, and other parameter for the data set in function calling. How can I do that ?
@Peterdemeter123
@Peterdemeter123 5 ай бұрын
very good job
@bkrai
@bkrai 5 ай бұрын
Thanks for comments!
@kumarsabat1520
@kumarsabat1520 6 жыл бұрын
One Word --- Awesome , Thanks Sir..
@bkrai
@bkrai 3 жыл бұрын
Welcome!
@anjaliacharya9506
@anjaliacharya9506 5 жыл бұрын
I cannot understand why do we use slice ?Could you please explain more about it.
@kapilkaramchandani5471
@kapilkaramchandani5471 6 жыл бұрын
My dataset is multi variable how can i apply svm on it, can u help me??
@bkrai
@bkrai 6 жыл бұрын
What do you mean by multi variable? Does it mean more than one variable? If yes, then you should have no problem applying svm.
@muharremakcora4361
@muharremakcora4361 5 жыл бұрын
@@bkrai R is telling me "all arguments must have the same length" how can I solve this problem ?
@joujoumilor2898
@joujoumilor2898 5 жыл бұрын
you're the best teacher ever
@bkrai
@bkrai 5 жыл бұрын
Thanks for your comments!
@Chuukwudi
@Chuukwudi 3 жыл бұрын
Thank you very much from the bottom of my heart.
@bkrai
@bkrai 3 жыл бұрын
You are very welcome!
@parasrai145
@parasrai145 6 жыл бұрын
Very well explained and very useful!
@bkrai
@bkrai 6 жыл бұрын
Thanks!
@Idk-bw3ib
@Idk-bw3ib 2 жыл бұрын
why didnt u split data to test and train before
@bkrai
@bkrai 2 жыл бұрын
It is always good to split data. I didn't do it here to keep the video short.
@Idk-bw3ib
@Idk-bw3ib 2 жыл бұрын
If I splited data, which data I would be performing the SVM models on, test or train
@Idk-bw3ib
@Idk-bw3ib 2 жыл бұрын
And Thank you professor:D
@bkrai
@bkrai 2 жыл бұрын
We develop the model using train data.
@bkrai
@bkrai 2 жыл бұрын
You are welcome!
@netmarketer77
@netmarketer77 4 жыл бұрын
Thanks. Why the iris data is not partitioned to train and test in this tutorial?
@bkrai
@bkrai 4 жыл бұрын
I did it to keep length of the video small. But data partitioning should be done for all machine learning methods.
@netmarketer77
@netmarketer77 4 жыл бұрын
@@bkrai Thanks Sir.
@bkrai
@bkrai 4 жыл бұрын
welcome!
@asmam-k7150
@asmam-k7150 4 жыл бұрын
Hello sir! This was very helpful thank you so much.. Can you please tell me how to split the data into train and test because I didn't understand quite well how you split the data here.. Or if there is a link to w pervious tutorial.. Thank you so much
@netmarketer77
@netmarketer77 4 жыл бұрын
@@asmam-k7150 You can see kzbin.info/www/bejne/iH3NhISamMxrd68
@louaguilar890
@louaguilar890 5 жыл бұрын
Error in svm.default(x, y, scale = scale, ..., na.action = na.action) : Need numeric dependent variable for regression. why do I always get this error whenever I'm using this formula? mymodel
@bkrai
@bkrai 5 жыл бұрын
What is dependent variable in your data?
@louaguilar890
@louaguilar890 5 жыл бұрын
Thank you for your response. I also tried the iris data and follow the tutorial, but still got the same error.
@shareefamohamed193
@shareefamohamed193 4 жыл бұрын
Sir, how to identify the important variables in SVM when we have a set of variables?
@helloinfo7657
@helloinfo7657 5 жыл бұрын
hi sir we need svm treat binary database on java would help us with this?
@kalyanasundaramsp8267
@kalyanasundaramsp8267 6 жыл бұрын
sorry typo in the previous question, for discrete independent variables, can we use them as factors in our model
@bkrai
@bkrai 6 жыл бұрын
Factor variables are usually of "nominal" type. For definitions you can use this link: kzbin.info/www/bejne/Z5mpYattjNiJhas
@praveenparmar7728
@praveenparmar7728 5 жыл бұрын
Its very pretty, sir please share the link of R script
@anjana8080
@anjana8080 7 жыл бұрын
excellent really worth
@bkrai
@bkrai 3 жыл бұрын
Thanks!
@ivanperezrubio2054
@ivanperezrubio2054 5 жыл бұрын
Thanks a lot Dr. Rai for uploading this tutorial. I would like to apply this SVM method to calculate a susceptibility index able to be plotted in ArcGIS, so I need to know the predicted values of the dependence variable: 1. How can be calculated? 2. Can I use for that the same coding as in the case of neural network? Thank you very much
@navdeepagrawal7819
@navdeepagrawal7819 2 жыл бұрын
Hii, I am also facing a similar issue. I have developed the model using the training dataset and tested it. But I am not sure how to import the developed model in ArcGIS to apply it to the actual raster layers!! Can you help me out?
@RohitRajputshiv
@RohitRajputshiv 7 жыл бұрын
Thank you sir....
@bkrai
@bkrai 3 жыл бұрын
Welcome!
@NIRAV2954
@NIRAV2954 6 жыл бұрын
where can i find your r code ???
@bkrai
@bkrai 6 жыл бұрын
Here is the link: drive.google.com/open?id=0B5W8CO0Gb2GGc1ZZQWhmMmpuWWc
@kalyanasundaramsp8267
@kalyanasundaramsp8267 6 жыл бұрын
sir, cost function = should it always start from 2 or we can have 3 to the power of ?
@bkrai
@bkrai 6 жыл бұрын
with 2 square, we start at cost value of 4 and then go to 8, 16, etc.. With 3 square, it will start at 9 and then jump to 27, 81, etc. But you can try it and see if it helps or not.
@mahtabalam379
@mahtabalam379 5 жыл бұрын
Sir, please attach R command file.
@chadhamhalla7310
@chadhamhalla7310 4 жыл бұрын
Thank you so much Sir!
@bkrai
@bkrai 4 жыл бұрын
Most welcome!
Support Vector Machines in Python from Start to Finish.
44:49
StatQuest with Josh Starmer
Рет қаралды 135 М.
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 19 МЛН
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 261 МЛН
Do you choose Inside Out 2 or The Amazing World of Gumball? 🤔
00:19
Support Vector Machines (SVM) - the basics | simply explained
28:44
Support Vector Machines: All you need to know!
14:58
Intuitive Machine Learning
Рет қаралды 147 М.
16. Learning: Support Vector Machines
49:34
MIT OpenCourseWare
Рет қаралды 2 МЛН
The Kernel Trick in Support Vector Machine (SVM)
3:18
Visually Explained
Рет қаралды 262 М.
Support Vector Machines (SVM) Overview and Demo using R
16:57
Support Vector Regression SVR
8:28
Super Data Science
Рет қаралды 16 М.
Support Vector Machines Part 1 (of 3): Main Ideas!!!
20:32
StatQuest with Josh Starmer
Рет қаралды 1,3 МЛН
Feature Selection Using R | Machine Learning Models using Boruta Package
16:28
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 19 МЛН