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

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

ความคิดเห็น • 244

  • @sojibulislam1004
    @sojibulislam1004 2 ปีที่แล้ว +1

    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!

  • @delt19
    @delt19 6 ปีที่แล้ว +2

    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!

  • @AnalyticsMaster
    @AnalyticsMaster 7 ปีที่แล้ว +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!

  • @RamoSFTT
    @RamoSFTT 6 ปีที่แล้ว +1

    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!

  • @kabeeradebayo9014
    @kabeeradebayo9014 7 ปีที่แล้ว +2

    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!

  • @williamlouis5883
    @williamlouis5883 4 ปีที่แล้ว +2

    #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.

  • @kabeeradebayo9014
    @kabeeradebayo9014 7 ปีที่แล้ว +2

    Thank you for your made simple and easy to follow video tutorials. You are awesome!

    • @bkrai
      @bkrai  7 ปีที่แล้ว

      Thanks for your feedback!

  • @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

  • @tadessemelakuabegaz9615
    @tadessemelakuabegaz9615 2 ปีที่แล้ว +1

    Thank you so much. A great explanation of the SVM model.

    • @bkrai
      @bkrai  2 ปีที่แล้ว

      You are welcome!

  • @joujoumilor2898
    @joujoumilor2898 6 ปีที่แล้ว +2

    you're the best teacher ever

    • @bkrai
      @bkrai  6 ปีที่แล้ว

      Thanks for your comments!

  • @juancorderoromero6610
    @juancorderoromero6610 3 ปีที่แล้ว +1

    Thank you Dr. Rai. This video was really helpful and entertaining.

    • @bkrai
      @bkrai  3 ปีที่แล้ว

      You are welcome!

  • @bhavikdudhrejiya4478
    @bhavikdudhrejiya4478 5 ปีที่แล้ว +1

    Very nice video. Easy to understand. Appreciated your effort.

    • @bkrai
      @bkrai  5 ปีที่แล้ว

      Thanks for comments!

  • @ravindarmadishetty736
    @ravindarmadishetty736 7 ปีที่แล้ว +2

    Excellent Session sir on SVM...Very Useful

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Thanks!

  • @BalasubrahmanyamIra
    @BalasubrahmanyamIra 6 ปีที่แล้ว

    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?

  • @shalinikumari-gk3ls
    @shalinikumari-gk3ls ปีที่แล้ว +1

    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!

  • @zhangting1446
    @zhangting1446 7 ปีที่แล้ว +2

    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.

  • @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?

  • @sandeepmane8694
    @sandeepmane8694 3 ปีที่แล้ว +1

    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!

  • @kalyanasundaramsp8267
    @kalyanasundaramsp8267 6 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      thankyou sir, can you please share the link

    • @bkrai
      @bkrai  6 ปีที่แล้ว

      Here is the link:
      drive.google.com/open?id=0B5W8CO0Gb2GGc1ZZQWhmMmpuWWc

  • @flamboyantperson5936
    @flamboyantperson5936 6 ปีที่แล้ว +5

    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.

  • @kumarsabat1520
    @kumarsabat1520 7 ปีที่แล้ว +2

    One Word --- Awesome , Thanks Sir..

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Welcome!

  • @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 ปีที่แล้ว +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 ปีที่แล้ว +1

      Thanks for your comments! I'll plan to do python in few months.

  • @vishnunath1524
    @vishnunath1524 7 ปีที่แล้ว +2

    Thank you Mr. Rai for this excellent demonstration and explanation of SVM.
    Regards.

    • @bkrai
      @bkrai  7 ปีที่แล้ว +1

      thanks for feedback!

  • @kuirfan1085
    @kuirfan1085 5 ปีที่แล้ว +1

    Very good explanation! Instantly subscribed to your channel.

    • @bkrai
      @bkrai  5 ปีที่แล้ว

      Thanks for comments!

  • @netmarketer77
    @netmarketer77 4 ปีที่แล้ว +1

    Thanks. Why the iris data is not partitioned to train and test in this tutorial?

    • @bkrai
      @bkrai  4 ปีที่แล้ว +1

      I did it to keep length of the video small. But data partitioning should be done for all machine learning methods.

    • @netmarketer77
      @netmarketer77 4 ปีที่แล้ว +1

      @@bkrai Thanks Sir.

    • @bkrai
      @bkrai  4 ปีที่แล้ว +1

      welcome!

    • @asmam-k7150
      @asmam-k7150 4 ปีที่แล้ว +1

      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 ปีที่แล้ว +2

      @@asmam-k7150 You can see th-cam.com/video/RLjSQdcg8AM/w-d-xo.html

  • @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

  • @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?

  • @supratikg1
    @supratikg1 4 หลายเดือนก่อน +1

    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  4 หลายเดือนก่อน

      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 4 หลายเดือนก่อน

      Thank you sir

  • @zhuziyan9454
    @zhuziyan9454 6 ปีที่แล้ว +2

    god blesses you sir. You are the best and much appreciate!!!

    • @bkrai
      @bkrai  6 ปีที่แล้ว

      Thanks for comments!

  • @nimishapapineni2216
    @nimishapapineni2216 4 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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.

  • @tmitra001
    @tmitra001 3 ปีที่แล้ว

    I did this
    tuned_model

  • @chinois2100
    @chinois2100 3 ปีที่แล้ว +1

    Hi why are you doing the typical training and test data in this case?

    • @bkrai
      @bkrai  3 ปีที่แล้ว

      That can be easily done here too.

  • @abiani007
    @abiani007 4 ปีที่แล้ว +1

    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  4 ปีที่แล้ว

      Unfortunately I don't use matlab.

  • @HeinyThet
    @HeinyThet 7 ปีที่แล้ว +2

    Very clear and helpful. Thank you sir!

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Welcome!

  • @kassemdia5932
    @kassemdia5932 4 ปีที่แล้ว +1

    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  4 ปีที่แล้ว

      The others can be tried in the same way.

  • @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
    >

  • @marcoesteves4367
    @marcoesteves4367 4 ปีที่แล้ว +1

    Dr, do you have any numeric svm (regression) tutorial?

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Not yet.

  • @vjysri2756
    @vjysri2756 4 ปีที่แล้ว +1

    Is there any way to extract varibale importance in SVM ?. If so could you please suggest how to do that. Thanks

    • @bkrai
      @bkrai  4 ปีที่แล้ว +1

      You can try feature extraction using the link below before doing svm:
      th-cam.com/video/VEBax2WMbEA/w-d-xo.html

    • @vjysri2756
      @vjysri2756 4 ปีที่แล้ว

      Dr. Bharatendra Rai Thanks.

  • @poornalya9605
    @poornalya9605 3 ปีที่แล้ว

    Sir for large sample value what could be the value of epsilon and cost..

  • @jasonyao3762
    @jasonyao3762 4 ปีที่แล้ว +1

    Many thanks sir,thank you!I have a question for you. In the following statement: "mymodel

    • @bkrai
      @bkrai  4 ปีที่แล้ว +1

      It's because of 2D plot only 2 variables can be accommodated.

    • @jasonyao3762
      @jasonyao3762 4 ปีที่แล้ว +1

      @@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?

  • @ShubhamKumar-xy6kj
    @ShubhamKumar-xy6kj 4 ปีที่แล้ว +1

    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.

  • @shubhamtalware5233
    @shubhamtalware5233 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      For ANN, you can use:
      th-cam.com/video/SrQw_fWo4lw/w-d-xo.html

    • @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.

  • @parasrai145
    @parasrai145 6 ปีที่แล้ว +2

    Very well explained and very useful!

    • @bkrai
      @bkrai  6 ปีที่แล้ว

      Thanks!

  • @kathytovar7112
    @kathytovar7112 7 ปีที่แล้ว +1

    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:
      th-cam.com/users/edit?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:
      th-cam.com/video/7xDAYa6Ouo8/w-d-xo.html

  • @ArpitSingh-dz7gt
    @ArpitSingh-dz7gt 4 ปีที่แล้ว +1

    Sir what does slice =list (sepal. Width=3,sepal.length=4 ) indicates?

    • @bkrai
      @bkrai  4 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

    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.

  • @shapeletter
    @shapeletter 4 ปีที่แล้ว +1

    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?

  • @kalyanasundaramsp8267
    @kalyanasundaramsp8267 6 ปีที่แล้ว +1

    Sir, for discrete independent variables, can we use them as factors model?

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Yes, should work fine.

  • @ashraffashafsheh1785
    @ashraffashafsheh1785 4 ปีที่แล้ว +1

    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:
      th-cam.com/video/Ho2Klvzjegg/w-d-xo.html

  • @jitendratrivedi7889
    @jitendratrivedi7889 6 ปีที่แล้ว +2

    very informative and well explained.

    • @bkrai
      @bkrai  6 ปีที่แล้ว

      Thanks for your comments!

  • @maheshmahi1593
    @maheshmahi1593 7 ปีที่แล้ว

    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

  • @rajthakkar9614
    @rajthakkar9614 4 ปีที่แล้ว +2

    Very good content Sirji!
    Sir how to used the best model for testing data set ?

    • @bkrai
      @bkrai  4 ปีที่แล้ว +1

      Instead of iris data with the model, you can use test data.

    • @rajthakkar9614
      @rajthakkar9614 4 ปีที่แล้ว +2

      @@bkrai Thanks Sirji

    • @bkrai
      @bkrai  4 ปีที่แล้ว +1

      welcome!

  • @swamchem
    @swamchem 7 ปีที่แล้ว +3

    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 ปีที่แล้ว +1

      oh fine sir.

  • @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?

  • @Chuukwudi
    @Chuukwudi 4 ปีที่แล้ว +1

    Thank you very much from the bottom of my heart.

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      You are very welcome!

  • @dennismontoro7312
    @dennismontoro7312 6 ปีที่แล้ว +1

    Does SVM capture the nonlinear interaction effects across variables when using RBF?

    • @bkrai
      @bkrai  6 ปีที่แล้ว +1

      That's correct.

  • @statisticalworld1133
    @statisticalworld1133 4 ปีที่แล้ว +1

    You are really great Sir!!!!

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Thanks for comments!

  • @bugsysiegals
    @bugsysiegals 6 ปีที่แล้ว +1

    Excellent video!! Thanks for sharing.

    • @bkrai
      @bkrai  6 ปีที่แล้ว

      Thanks for comments!

  • @marces1009
    @marces1009 4 ปีที่แล้ว

    Thanks for your video!! How to calculate AIC and BIC in SVM?

  • @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 ?

  • @machinelearningzone.6230
    @machinelearningzone.6230 5 ปีที่แล้ว +2

    Hi sir,
    Can you please explain the significance of the parameters epsilon!
    Regards

    • @bkrai
      @bkrai  4 ปีที่แล้ว +2

      It affects the number of support vectors.

  • @saikiran-fc8xc
    @saikiran-fc8xc 4 ปีที่แล้ว +1

    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.

  • @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?

  • @Didanihaaaa
    @Didanihaaaa 6 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      Thanks for the suggestion, I;ve added this to my list.

  • @ajantaakhuly5237
    @ajantaakhuly5237 4 ปีที่แล้ว +1

    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  4 ปีที่แล้ว

      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.

  • @raniash3ban383
    @raniash3ban383 6 ปีที่แล้ว +2

    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

  • @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:
      th-cam.com/video/1hF0x7WsVOI/w-d-xo.html

  • @FunTime-hq9ce
    @FunTime-hq9ce 6 ปีที่แล้ว +1

    how qplot done
    if we more number of variable then what can I use qplot

    • @bkrai
      @bkrai  6 ปีที่แล้ว

      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.

  • @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?

  • @NAMHAIDORJ830
    @NAMHAIDORJ830 7 ปีที่แล้ว +1

    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.

  • @shuchismitagiri9257
    @shuchismitagiri9257 2 ปีที่แล้ว +1

    Thank you sir for this video

    • @bkrai
      @bkrai  2 ปีที่แล้ว

      Most welcome!

  • @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.

  • @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?

  • @anjaliacharya9506
    @anjaliacharya9506 5 ปีที่แล้ว

    I cannot understand why do we use slice ?Could you please explain more about it.

  • @kapilkaramchandani5471
    @kapilkaramchandani5471 6 ปีที่แล้ว +1

    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 6 ปีที่แล้ว

      @@bkrai R is telling me "all arguments must have the same length" how can I solve this problem ?

  • @louaguilar890
    @louaguilar890 6 ปีที่แล้ว

    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  6 ปีที่แล้ว

      What is dependent variable in your data?

    • @louaguilar890
      @louaguilar890 6 ปีที่แล้ว

      Thank you for your response. I also tried the iris data and follow the tutorial, but still got the same error.

  • @linkmetoo
    @linkmetoo 7 ปีที่แล้ว

    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  7 ปีที่แล้ว

      I would suggest try and use the same format as shown in the video.

  • @jaydeepraut5374
    @jaydeepraut5374 4 ปีที่แล้ว +1

    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.

  • @asmam-k7150
    @asmam-k7150 4 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      Here is a link that has more details:
      th-cam.com/play/PL34t5iLfZddspfUiv-9EaOVNUG64_fwFq.html

    • @asmam-k7150
      @asmam-k7150 4 ปีที่แล้ว

      Thank you 😁

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      welcome!

  • @priyadipmanna4393
    @priyadipmanna4393 5 ปีที่แล้ว +1

    graet video sir.. sir can u make a video on Taylors diagram.

    • @bkrai
      @bkrai  5 ปีที่แล้ว

      Thanks for comments and suggestion!

  • @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.

  • @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?

  • @Peterdemeter123
    @Peterdemeter123 8 หลายเดือนก่อน +1

    very good job

    • @bkrai
      @bkrai  8 หลายเดือนก่อน

      Thanks for comments!

  • @me3jab1
    @me3jab1 5 ปีที่แล้ว +1

    good explanation

    • @bkrai
      @bkrai  5 ปีที่แล้ว

      Thanks for comments!

  • @divyasree3261
    @divyasree3261 4 ปีที่แล้ว +1

    My data is qualitative it contains all variables are categorical...is svm applicable to my data??

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Try random forest.

  • @adedayoadeyemi7671
    @adedayoadeyemi7671 7 ปีที่แล้ว +1

    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

  • @Sergei_B
    @Sergei_B 6 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      thanks for the suggestion, I've added it to my list.

  • @chadhamhalla7310
    @chadhamhalla7310 4 ปีที่แล้ว +1

    Thank you so much Sir!

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Most welcome!

  • @anjana8080
    @anjana8080 7 ปีที่แล้ว +2

    excellent really worth

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Thanks!

  • @NIRAV2954
    @NIRAV2954 6 ปีที่แล้ว +1

    where can i find your r code ???

    • @bkrai
      @bkrai  6 ปีที่แล้ว +2

      Here is the link:
      drive.google.com/open?id=0B5W8CO0Gb2GGc1ZZQWhmMmpuWWc

  • @praveenparmar7728
    @praveenparmar7728 5 ปีที่แล้ว

    Its very pretty, sir please share the link of R script

  • @BigBrother4Life
    @BigBrother4Life 2 ปีที่แล้ว +1

    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?

  • @RohitRajputshiv
    @RohitRajputshiv 7 ปีที่แล้ว +3

    Thank you sir....

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      Welcome!

  • @bharathjc4700
    @bharathjc4700 7 ปีที่แล้ว

    what is set.seed ?how do we decide set .seed value?

    • @bkrai
      @bkrai  7 ปีที่แล้ว

      you can choose any number you like. And then you can use that same number when you try to repeat analysis with same results.

  • @Idk-bw3ib
    @Idk-bw3ib 3 ปีที่แล้ว +1

    why didnt u split data to test and train before

    • @bkrai
      @bkrai  3 ปีที่แล้ว +1

      It is always good to split data. I didn't do it here to keep the video short.

    • @Idk-bw3ib
      @Idk-bw3ib 3 ปีที่แล้ว +1

      If I splited data, which data I would be performing the SVM models on, test or train

    • @Idk-bw3ib
      @Idk-bw3ib 3 ปีที่แล้ว +1

      And Thank you professor:D

    • @bkrai
      @bkrai  3 ปีที่แล้ว

      We develop the model using train data.

    • @bkrai
      @bkrai  3 ปีที่แล้ว

      You are welcome!

  • @thejuhulikal6290
    @thejuhulikal6290 3 ปีที่แล้ว

    Thanks again, sir! please upload the R file sir.

  • @muhammadhamzahm1204
    @muhammadhamzahm1204 6 ปีที่แล้ว +1

    Good

    • @bkrai
      @bkrai  4 ปีที่แล้ว

      thx

  • @dhanashreedeshpande7100
    @dhanashreedeshpande7100 7 ปีที่แล้ว

    ROC Curve & AUC value Demo should be here

    • @bkrai
      @bkrai  7 ปีที่แล้ว

      You can find them here: th-cam.com/video/ypO1DPEKYFo/w-d-xo.html