Linear Discriminant Analysis in R | Example with Classification Model & Bi-Plot interpretation

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024

Комментарии • 131

  • @askpioneer
    @askpioneer 2 года назад +1

    Wow. I acknowledge your simplicity in teaching complicated topics .
    Your accuracy is close to 99.99% .
    Thank you so much for creating LDR video.

    • @bkrai
      @bkrai  2 года назад

      You are very welcome!

  • @bhavikdudhrejiya4447
    @bhavikdudhrejiya4447 4 года назад +2

    I have been watching almost all the videos since last year and I felt the most satisfaction at the end.

    • @bkrai
      @bkrai  4 года назад +1

      Thanks and welcome!

  • @TheAdamSmithh
    @TheAdamSmithh 4 года назад +7

    This is a very understandable video! I'm saving it to use on a project.

    • @bkrai
      @bkrai  4 года назад +2

      Thanks for comments!

  • @nyatonkitnya4267
    @nyatonkitnya4267 3 года назад +3

    Made it very simple n easy to follow for a beginner like me. Thank you. looking up for more videos for other stats.

    • @bkrai
      @bkrai  3 года назад

      You are welcome!

  • @flamboyantperson5936
    @flamboyantperson5936 6 лет назад +2

    Great video Sir. Whenever I have holiday I sit down and watch your videos it gives me immense knowledge. You are a great Professor. Thank you so much for imparting knowledge to student like us back home in India. Thank you.

    • @bkrai
      @bkrai  6 лет назад

      Thanks!

  • @tufleuddinbiswas7579
    @tufleuddinbiswas7579 5 лет назад +1

    First time I am commenting a video in youtube. You have done an amazing job sir. Thank you so much sir.

    • @bkrai
      @bkrai  5 лет назад

      Thanks for your comments!

  • @hemantjoshi5034
    @hemantjoshi5034 Год назад +1

    Thank you for posting such a informative learning video.

    • @bkrai
      @bkrai  Год назад

      You are welcome!

    • @hemantjoshi5034
      @hemantjoshi5034 Год назад

      Sir, you can pls some data set for practising LDA or source from where I can get it

    • @hemantjoshi5034
      @hemantjoshi5034 Год назад

      @@bkrai Also, Sir how the discriminant function got determined - simultaneous estimation or stepwise estimation. I am keen to learn same and observe the difference

  • @shivam2011ful
    @shivam2011ful 3 года назад +1

    Very well explained, I am using LDA in one of my projects.

    • @bkrai
      @bkrai  3 года назад

      Thanks for comments!

  • @wafaaziane
    @wafaaziane 5 лет назад +6

    Thank you Sir so much for the tutorial, very helpful!

    • @bkrai
      @bkrai  5 лет назад

      Thanks for comments!

  • @caamitjaiswal
    @caamitjaiswal 4 года назад +2

    Hi sir, great and very simple way of teaching. I am CA by profession and made earlier request to post some end to end case studies how to solve finance and fraud analytics domain specific problem. Will wait for your guidance.

    • @bkrai
      @bkrai  4 года назад +1

      Will try to upload around May.

  • @marcoseliseodominguezarrio706
    @marcoseliseodominguezarrio706 4 года назад +2

    Tremendously helpful video, thank you!

    • @bkrai
      @bkrai  4 года назад

      You're very welcome!

  • @sureshkm
    @sureshkm 4 года назад +1

    Thank you so much for the step by step explanation!

    • @bkrai
      @bkrai  4 года назад

      You're very welcome!

  • @abhishekmuralidhar1146
    @abhishekmuralidhar1146 2 года назад +1

    This was simple and awesome. Thank you so much

    • @bkrai
      @bkrai  2 года назад

      Thanks for comments!

  • @tayseldemi
    @tayseldemi 7 лет назад +3

    Thank you so much! This has been very useful!

    • @bkrai
      @bkrai  7 лет назад

      thanks for feedback!

  • @alejandromorales3545
    @alejandromorales3545 5 лет назад +6

    Hello! very good tutorial
    I have a question, I could not install the package in any way. I try to update r but it does not load the package.
    There is another package to do the biplot.

    • @bkrai
      @bkrai  2 года назад

      Sorry saw this just now. Use these lines as shown in the video:
      library(devtools)
      install_github("fawda123/ggord")
      library(ggord)

  • @mtcuyler
    @mtcuyler 7 лет назад +6

    This is an excellent video. Why does the output generate a table with two separate coefficients of linear discriminants LD1 and LD2?

    • @bkrai
      @bkrai  7 лет назад

      To separate three types of species, we need 3-1=2 discriminant functions.

    • @BadriSea
      @BadriSea 5 лет назад

      Very Crisp video; How does these functions look like? Or just a sum product of co-efficients and individual values of sepal width,breath etc?

  • @poojamahesh8594
    @poojamahesh8594 3 года назад +1

    very usefull vedio sir, thank you very much

    • @bkrai
      @bkrai  3 года назад

      Most welcome!

  • @surbhiagrawal3951
    @surbhiagrawal3951 4 года назад +1

    Very well explained ,, can you please explain where is the video of the predictor varaibles are also qualitative in LDA?.. plz provide link

    • @bkrai
      @bkrai  4 года назад

      Independent variables need to be quantitative.

  • @DannyTheHun
    @DannyTheHun 5 лет назад +1

    Very useful, many thanks!

    • @bkrai
      @bkrai  5 лет назад

      Thanks for comments!

  • @twinklesaini8703
    @twinklesaini8703 2 года назад +1

    This is a very understandable video! but sir ggord library is not available in R then what we do for this?

    • @bkrai
      @bkrai  2 года назад +1

      Use these lines as shown in the video:
      library(devtools)
      install_github("fawda123/ggord")
      library(ggord)

  • @johntriantafillakis8548
    @johntriantafillakis8548 2 года назад +2

    Excellent tutorial! Totally helped a lot. Shouldn't we though check for 1) Assumption of Multivariate Normal Distribution and Variance Matrices before we decide whether we will use Linear Discr. Analysis or Quadratic Discr. Analysis?? Thanks once again for the helpful video

    • @bkrai
      @bkrai  2 года назад +1

      You are 100% correct!

  • @poojamahesh8594
    @poojamahesh8594 3 года назад

    for the model, i need to find the kappa and precision values for training and testing datasets,..kindly help with this sir...please

  • @khansahyder2533
    @khansahyder2533 2 года назад +1

    When I m running lda there is error variable are constant within grouping how to fix this error
    My output is binary0/1 and independent are fctor and binary

    • @bkrai
      @bkrai  2 года назад

      If you have any independent variable which is constant, you need to remove that variable.

  • @dilshadsaeed2857
    @dilshadsaeed2857 2 года назад +1

    Dear professor . thanks a lot for every thing you present. Really I so interested from your lectures. I need to enable the CC (subtitle) button on your video because I need your comment on result please if its can do it for me. Thanks again.

    • @bkrai
      @bkrai  2 года назад +1

      Ok, I'll try to do this.

  • @dhanashreedeshpande7100
    @dhanashreedeshpande7100 6 лет назад +1

    Can we apply LDA to Random Forest ? I was trying to do it in R. I had 30 independent variables and 1 dependent variables (2 categories). LDA has reduced the independent variables into 1. So number of variables tried at each split was 1 (only LD1). OOB estimate of error rate = 0%. Accuracy = 100%. So. please tell me LDA can be applied on Random Forest? Is it ok to apply Random Forest on only 1 variable ?

  • @petersonmcdavid5520
    @petersonmcdavid5520 5 лет назад +2

    Hey Good Night . I tried running the lda function and get getting the message "lda.default(x, grouping, ...) : variables are collinear " ...... what is the problem?
    The data frame has 1300 obs and 19 variables but the last column is the Group (or in this case the species).
    What should I do to use the LDA()?

    • @bkrai
      @bkrai  5 лет назад +1

      If there is multicollinearity problem, you can do principal component analysis. Here is the link: ruclips.net/video/OowGKNgdowA/видео.html

  • @bmukh
    @bmukh 7 лет назад +2

    Excellent Video

  • @ShubhamKumar-xy6kj
    @ShubhamKumar-xy6kj 4 года назад +1

    Sir, why the proportion of trace is not showing in my output.

    • @bkrai
      @bkrai  4 года назад

      Which line of code are you referring to?

  • @jmbayo
    @jmbayo 6 лет назад +2

    Thanks so much for your video!. There is any function that I use to define to which specie belongs a new sample? without running the predictor?

    • @bkrai
      @bkrai  6 лет назад

      I'm not sure about purpose behind it. If you want to make prediction, then predict function can be used.

  • @marcelapena5890
    @marcelapena5890 4 года назад +1

    Are you sure that the statement at 0.34 s? Is it not a singe categorical independent and several dependent vars? Thanks

    • @bkrai
      @bkrai  4 года назад

      Did you see anything unusual there? The example used in this videos has similar situation.

  • @jainhardik
    @jainhardik 3 года назад +1

    Sir please explain the working behind the code

    • @bkrai
      @bkrai  3 года назад

      I'll do it in future video.

  • @cassiositta8483
    @cassiositta8483 6 лет назад

    Excellent Video Mr. Bharatendra Rai. How to make the bi-plot with more than 3 groups? I was not able to do it. Thank you very much.

  • @RameshChandraDas
    @RameshChandraDas 2 года назад +1

    Sir, could you help me for running bi-plot and partition plot in R. Not able to install.packages.

    • @bkrai
      @bkrai  2 года назад +2

      Use these lines as shown in the video:
      library(devtools)
      install_github("fawda123/ggord")
      library(ggord)

    • @RameshChandraDas
      @RameshChandraDas 2 года назад +1

      Thanks a lot sir

  • @anassrtimi3015
    @anassrtimi3015 6 лет назад +1

    Thank you sir for these tutorials

    • @bkrai
      @bkrai  6 лет назад

      Thanks for your comments!

  • @facundollompart7662
    @facundollompart7662 3 года назад

    Thanks a lot, so clear. How can you test the lda assumptions? Can qda handle with non normality/ not equal covariance?. Does qda the same attributes ("prior", "counts", etc) as lda?

  • @sandrolucena2078
    @sandrolucena2078 3 года назад +1

    Very very good

    • @bkrai
      @bkrai  3 года назад

      Thanks!

  • @ivanantonio2787
    @ivanantonio2787 6 лет назад +2

    thanks for the video! i have a couple of questions.
    ¿What is the meaning of the coheficient of variation in the 2-D plot, how can I interpret it?

    • @bkrai
      @bkrai  6 лет назад

      What time point in the video are you referring to?

  • @mutindafestus5619
    @mutindafestus5619 6 лет назад +1

    excellent but i had an issue in installing the ggord package please help

    • @bkrai
      @bkrai  2 года назад

      Sorry saw this today. Use these lines as shown in the video:
      library(devtools)
      install_github("fawda123/ggord")
      library(ggord)
      I just ran them in RStudio cloud and worked fine.

  • @yhxr1997
    @yhxr1997 6 лет назад

    Why is the 79th predicted data point is Versicolor and not Virginia species? I am puzzle on how these species are able to be grouped together during prediction.

  • @redarabie7098
    @redarabie7098 6 лет назад +1

    Thank you for this video i try to applied Linear Discriminant to my data or case study and i foud this ereur [ In lda.default(x, grouping, ...) : les variables sont collinéaires ] what can i do to resolve this error and thank you

    • @petersonmcdavid5520
      @petersonmcdavid5520 5 лет назад

      i got the same error were you able to resolve the problem.

  • @vincyyu1074
    @vincyyu1074 7 лет назад +1

    Hi thank you for sharing! It is a great video. I want to test my knowledge using a different R built-in package. What dataset would you suggest?

    • @bkrai
      @bkrai  6 лет назад

      You can try iris data.

  • @supra20000000
    @supra20000000 7 лет назад +2

    Awesome videos.
    During run I found this
    Error in FUN(X[[i]], ...) :
    cannot open file '~/R/win-library/3.4/MASS/data/Rdata.rdb': No such file or directory
    Is MASS package not working for my version of R studio, I have the latest one.
    Please help

    • @bkrai
      @bkrai  7 лет назад

      I would suggest upload the package again.

  • @redarabie7098
    @redarabie7098 6 лет назад +1

    thanks for this video. i have i problem in the creation of my model because the dimension of my data is very big so i try to do the partiel least square discriminant analysis PLS-DA can you help me if you can make a explination video for PLS-DA in R. and thank you

  • @Alfredo_Ortiz_Bio
    @Alfredo_Ortiz_Bio 5 лет назад +1

    What version of R is it? I have problem with ggord

    • @bkrai
      @bkrai  2 года назад

      Sorry saw this today. Use these lines as shown in the video:
      library(devtools)
      install_github("fawda123/ggord")
      library(ggord)

  • @davychavez3773
    @davychavez3773 5 лет назад

    What decision criteria would be use to classify new samples into a group after applying discriminants equations LD1 and LD2?
    How do this new individuals classification would be performed in R?

  • @victorhenostroza1871
    @victorhenostroza1871 5 лет назад +1

    Could yo please give a link to download the R file ?

    • @bkrai
      @bkrai  2 года назад

      Sorry seeing this today. The link is in the description below video.

  • @art.ventures
    @art.ventures 4 года назад +1

    Thanks so much

    • @bkrai
      @bkrai  4 года назад

      You're welcome!

  • @vaibhavchhaya9145
    @vaibhavchhaya9145 4 года назад +1

    Thank you sir! Can you follow it up with a video on Wilk's Lambda?

    • @bkrai
      @bkrai  4 года назад

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

  • @naeem3072
    @naeem3072 5 лет назад +1

    sir how we can perform LDA when we have binary output i.e when we have only two class "0" or "1" how we will get the graph biplots can u provide any link or solutions for my question is my question valid ??. because here u have 3 classes and we get LD1 and LD2

    • @gopherhubb4592
      @gopherhubb4592 5 лет назад

      The biplot uses LD1 for x-axis, and LD2 for Y-axis. Because you only have 2 classes options, you will only have LD1, therefore you can not produce a Biplot. Use the ldahist command in the video at around 9:37. For 2 classes your LD1 is responsible for 100% of the differences between classes (even if the classes are not distinct). The histogram will visually show you how distinct the differences are.

    • @petersonmcdavid5520
      @petersonmcdavid5520 5 лет назад

      lda.default(x, grouping, ...) : variables are collinear i continue getting this error how were u able to use the function?

  • @baphnie
    @baphnie 6 лет назад +1

    Package ggord is not available for R version 3.4.2.

    • @bkrai
      @bkrai  2 года назад

      Sorry saw this today. Use these lines as shown in the video:
      library(devtools)
      install_github("fawda123/ggord")
      library(ggord)

    • @baphnie
      @baphnie 2 года назад

      @@bkrai never too late! Thank you 🙏

  • @sunofentertainmentworld
    @sunofentertainmentworld Год назад +1

    Why is there LDA1 and LDA2?

    • @bkrai
      @bkrai  Год назад

      They help to separate 3 categories in the Species variable.

  • @mecharinga
    @mecharinga 4 года назад +1

    Great video thanks! Just a question, is there any book that you could recommend me to read about the LDA theory?

    • @bkrai
      @bkrai  4 года назад +2

      There are many books. You may try this:
      www.amazon.com/Data-Mining-Business-Intelligence-Applications/dp/0470526823

    • @mecharinga
      @mecharinga 4 года назад +1

      @@bkrai Thanks!!

    • @bkrai
      @bkrai  4 года назад

      Welcome!

  • @parasrai145
    @parasrai145 6 лет назад +2

    Awesome!

    • @bkrai
      @bkrai  6 лет назад

      Thanks

  • @laurykost
    @laurykost 5 лет назад +1

    Is a very helpful tutorial. Thank you. However, I could not install the Github('fawda123/ggord'). Is it maybe related with the R studio version?

    • @bkrai
      @bkrai  5 лет назад

      Make sure you have devtools before installing ggord.

    • @koparka112
      @koparka112 4 года назад +1

      ​@@bkrai Hello, I do have devtools, but (probably) my R 3.6.2 version does not accept the ggord. Is there any way around? Thanks!

  • @ranjithnair2659
    @ranjithnair2659 7 лет назад +2

    Can you please make a video to explain Extreme Gradient Boosting (xgboost)

    • @bkrai
      @bkrai  7 лет назад +1

      Thanks for the suggestion, I'll plan for sometime next month.

  • @tufleuddinbiswas7579
    @tufleuddinbiswas7579 5 лет назад +1

    Pls make videos of cluster analysis, factory analisis and canonical correlation sir using R.

    • @bkrai
      @bkrai  5 лет назад +2

      Here are some related to the topics you mentioned. Others I'll try to do in near future:
      ruclips.net/video/5eDqRysaico/видео.html
      ruclips.net/video/wLu213JKfnQ/видео.html
      ruclips.net/video/OowGKNgdowA/видео.html

    • @tufleuddinbiswas7579
      @tufleuddinbiswas7579 5 лет назад +1

      @@bkrai Thank you so much sir for replying so quick. Actually I am a student of statistics from agriculture background, few months back I have introduced myself in R software. Thanks God I have got your R Videos which is helping me in R.

    • @bkrai
      @bkrai  5 лет назад +1

      Good to hear that you are finding them useful.

  • @snehavaishu932
    @snehavaishu932 7 лет назад

    how do we handle factors in independent variable , should we convert those variables into dummy variables???

    • @bkrai
      @bkrai  7 лет назад +1

      Let's say your data file is named 'binary' and factor variable is named 'rank'. You use following:
      binary$rank

    • @snehavaishu932
      @snehavaishu932 7 лет назад +1

      thank you sir

  • @jazmanjef
    @jazmanjef 4 года назад +2

    This is indeed a great video but: There are dozens of these same videos and tutorials on the net using the "Iris" dataset .... if you use your own dataset, you will get all kinds of errors. This is one of the primary flaws/shortcomings of R-----it uses it's own ''canned/perfect" datasets to show you how it can do statistics, but then when you import your own data, variables are undefined, subsets end up with unequal 'n' and other issues that you have to troubleshoot piecemeal constantly before you get what you want. R and statistical analyses is exactly why SPSS and SAS were invented: because getting analyses on ones own data seamlessly is the most efficient driving force behind scientific progress.

    • @bkrai
      @bkrai  4 года назад

      Thanks for your feedback!

  • @kidscompany-td3bc
    @kidscompany-td3bc 5 лет назад +1

    I would like to Salute you :)

    • @bkrai
      @bkrai  5 лет назад

      Thanks for comments!

  • @saranggokte4165
    @saranggokte4165 4 года назад +1

    Also please upload the R script file next time.
    Thank you

    • @bkrai
      @bkrai  4 года назад +2

      See description area.

  • @Pankajjadwal
    @Pankajjadwal 7 лет назад

    Sir, Can you please provide me the code.

    • @bkrai
      @bkrai  7 лет назад +1

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

  • @WHÉLLEYIZIDRO
    @WHÉLLEYIZIDRO 4 месяца назад +1

    I'm sure this video has a good explanation of the analysis, but the fact that there are no subtitles really limits the understanding of non-English speakers.

    • @bkrai
      @bkrai  2 месяца назад

      Thanks for the feedback!