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

Поділитися
Вставка
  • Опубліковано 26 лис 2024
  • 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

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

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

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

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

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

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

  • @joujoumilor2898
    @joujoumilor2898 6 років тому +2

    you're the best teacher ever

    • @bkrai
      @bkrai  6 років тому

      Thanks for your comments!

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

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

  • @tadessemelakuabegaz9615
    @tadessemelakuabegaz9615 2 роки тому +1

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

    • @bkrai
      @bkrai  2 роки тому

      You are welcome!

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

  • @ravindarmadishetty736
    @ravindarmadishetty736 7 років тому +2

    Excellent Session sir on SVM...Very Useful

    • @bkrai
      @bkrai  3 роки тому

      Thanks!

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

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

  • @bhavikdudhrejiya4478
    @bhavikdudhrejiya4478 5 років тому +1

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

    • @bkrai
      @bkrai  5 років тому

      Thanks for comments!

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

  • @zhangting1446
    @zhangting1446 6 років тому +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.

  • @kumarsabat1520
    @kumarsabat1520 7 років тому +2

    One Word --- Awesome , Thanks Sir..

    • @bkrai
      @bkrai  3 роки тому

      Welcome!

  • @juancorderoromero6610
    @juancorderoromero6610 3 роки тому +1

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

    • @bkrai
      @bkrai  3 роки тому

      You are 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  3 роки тому

      The others can be tried in the same way.

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

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

  • @vishnunath1524
    @vishnunath1524 7 років тому +2

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

    • @bkrai
      @bkrai  7 років тому +1

      thanks for feedback!

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

  • @supratikg1
    @supratikg1 3 місяці тому +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  3 місяці тому

      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 2 місяці тому

      Thank you sir

  • @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 3 роки тому +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  3 роки тому

      Unfortunately I don't use matlab.

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

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

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

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

  • @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:
      ua-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:
      ua-cam.com/video/7xDAYa6Ouo8/v-deo.html

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

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

  • @parasrai145
    @parasrai145 6 років тому +2

    Very well explained and very useful!

    • @bkrai
      @bkrai  6 років тому

      Thanks!

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

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

  • @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:
      ua-cam.com/video/Ho2Klvzjegg/v-deo.html

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

  • @HeinyThet
    @HeinyThet 7 років тому +2

    Very clear and helpful. Thank you sir!

    • @bkrai
      @bkrai  3 роки тому

      Welcome!

  • @kuirfan1085
    @kuirfan1085 5 років тому +1

    Very good explanation! Instantly subscribed to your channel.

    • @bkrai
      @bkrai  5 років тому

      Thanks for comments!

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

  • @poornalya9605
    @poornalya9605 3 роки тому

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

  • @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:
      ua-cam.com/video/VEBax2WMbEA/v-deo.html

    • @vjysri2756
      @vjysri2756 4 роки тому

      Dr. Bharatendra Rai Thanks.

  • @zhuziyan9454
    @zhuziyan9454 6 років тому +2

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

    • @bkrai
      @bkrai  6 років тому

      Thanks for comments!

  • @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 3 роки тому +1

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

    • @bkrai
      @bkrai  3 роки тому

      Not yet.

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

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

  • @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:
      ua-cam.com/video/SrQw_fWo4lw/v-deo.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.

  • @kalyanasundaramsp8267
    @kalyanasundaramsp8267 6 років тому +1

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

    • @bkrai
      @bkrai  4 роки тому

      Yes, should work fine.

  • @bugsysiegals
    @bugsysiegals 6 років тому +1

    Excellent video!! Thanks for sharing.

    • @bkrai
      @bkrai  6 років тому

      Thanks for comments!

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

  • @tmitra001
    @tmitra001 3 роки тому

    I did this
    tuned_model

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

  • @Chuukwudi
    @Chuukwudi 3 роки тому +1

    Thank you very much from the bottom of my heart.

    • @bkrai
      @bkrai  3 роки тому

      You are very welcome!

  • @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 ua-cam.com/video/RLjSQdcg8AM/v-deo.html

  • @marces1009
    @marces1009 4 роки тому

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

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

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

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

  • @dennismontoro7312
    @dennismontoro7312 6 років тому +1

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

    • @bkrai
      @bkrai  6 років тому +1

      That's correct.

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

  • @anjaliacharya9506
    @anjaliacharya9506 5 років тому

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

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

  • @shareefamohamed193
    @shareefamohamed193 4 роки тому

    Sir, how to identify the important variables in SVM when we have a set of variables?

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

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

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

  • @ajantaakhuly5237
    @ajantaakhuly5237 3 роки тому +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  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.

  • @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:
      ua-cam.com/play/PL34t5iLfZddspfUiv-9EaOVNUG64_fwFq.html

    • @asmam-k7150
      @asmam-k7150 4 роки тому

      Thank you 😁

    • @bkrai
      @bkrai  4 роки тому

      welcome!

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

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

  • @statisticalworld1133
    @statisticalworld1133 4 роки тому +1

    You are really great Sir!!!!

    • @bkrai
      @bkrai  4 роки тому

      Thanks for comments!

  • @helloinfo7657
    @helloinfo7657 5 років тому

    hi sir we need svm treat binary database on java would help us with this?

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

  • @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:
      ua-cam.com/video/1hF0x7WsVOI/v-deo.html

  • @priyadipmanna4393
    @priyadipmanna4393 5 років тому +1

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

    • @bkrai
      @bkrai  5 років тому

      Thanks for comments and suggestion!

  • @praveenparmar7728
    @praveenparmar7728 5 років тому

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

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

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

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

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

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

  • @shuchismitagiri9257
    @shuchismitagiri9257 2 роки тому +1

    Thank you sir for this video

    • @bkrai
      @bkrai  2 роки тому

      Most welcome!

  • @me3jab1
    @me3jab1 5 років тому +1

    good explanation

    • @bkrai
      @bkrai  5 років тому

      Thanks for comments!

  • @Peterdemeter123
    @Peterdemeter123 7 місяців тому +1

    very good job

    • @bkrai
      @bkrai  7 місяців тому

      Thanks for comments!

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

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

  • @thejuhulikal6290
    @thejuhulikal6290 3 роки тому

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

  • @dr.divyasrivastava2820
    @dr.divyasrivastava2820 7 років тому +1

    tab

    • @bkrai
      @bkrai  4 роки тому

      Make sure pred and actual have same number of data points.

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

  • @chadhamhalla7310
    @chadhamhalla7310 4 роки тому +1

    Thank you so much Sir!

    • @bkrai
      @bkrai  4 роки тому

      Most welcome!

  • @Idk-bw3ib
    @Idk-bw3ib 2 роки тому +1

    why didnt u split data to test and train before

    • @bkrai
      @bkrai  2 роки тому +1

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

    • @Idk-bw3ib
      @Idk-bw3ib 2 роки тому +1

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

    • @Idk-bw3ib
      @Idk-bw3ib 2 роки тому +1

      And Thank you professor:D

    • @bkrai
      @bkrai  2 роки тому

      We develop the model using train data.

    • @bkrai
      @bkrai  2 роки тому

      You are welcome!

  • @anjana8080
    @anjana8080 7 років тому +2

    excellent really worth

    • @bkrai
      @bkrai  3 роки тому

      Thanks!

  • @dhanashreedeshpande7100
    @dhanashreedeshpande7100 7 років тому

    ROC Curve & AUC value Demo should be here

    • @bkrai
      @bkrai  7 років тому

      You can find them here: ua-cam.com/video/ypO1DPEKYFo/v-deo.html

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

  • @chd9841
    @chd9841 6 років тому +1

    That music....kept me awake

    • @bkrai
      @bkrai  6 років тому

      😊