Ridge, Lasso & Elastic Net Regression with R | Boston Housing Data Example, Steps & Interpretation

Sdílet
Vložit
  • čas přidán 27. 03. 2018
  • Provides example with interpretations of applying Ridge, Lasso & Elastic Net Regression using Boston Housing data.
    R file: goo.gl/ywtVYg
    Machine Learning videos: goo.gl/WHHqWP
    Includes.
    - example with Boston housing data
    - illustrates use of caret package
    - data partition
    - custom control parameters
    - cross validation
    - linear model
    - residuals plot
    - use of glmnet package
    - ridge regression
    - plot results
    - log lambda plot
    - fraction deviance explained plot
    - variable importance plot
    - interpretation
    - lasso regression
    - elastic net regression
    - compare models
    - best model
    - saving and reading final model for later use
    - prediction
    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.
    #ridge #elasticnet #lasso

Komentáře • 191

  • @bassamabdelnabi3117
    @bassamabdelnabi3117 Před 4 lety +4

    Thanks to you is not enough. You have done a lot to share knowledge with people. Great people like you are the people who make difference. Please continue to be generous and kind.

    • @bkrai
      @bkrai  Před 4 lety

      Thanks for your comments!

  • @chriss7771
    @chriss7771 Před 5 lety +2

    Great music... :) What a great video. I just learn so much from you. Thank you.

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @flamboyantperson5936
    @flamboyantperson5936 Před 6 lety +20

    Sir many many many thanks to you. I really have no words to thank you for making this video. I have looking for these three methods since a very long time on internet but I have not found it anywhere and you made it. I'm extremely happy and extremely thankful to you. You are the best Professor in the world. Respect.

    • @bkrai
      @bkrai  Před 6 lety +1

      Thanks for your comments!

    • @khalidalonso5172
      @khalidalonso5172 Před 2 lety

      i guess it is kinda off topic but do anyone know of a good website to stream newly released tv shows online?

    • @winstonedison2001
      @winstonedison2001 Před 2 lety

      @Khalid Alonso lately I have been using flixzone. Just search on google for it =)

    • @harlanmaverick3296
      @harlanmaverick3296 Před 2 lety

      @Winston Edison definitely, have been watching on FlixZone for months myself :)

    • @shanealec3399
      @shanealec3399 Před 2 lety

      @Winston Edison Thanks, signed up and it seems like they got a lot of movies there :) I appreciate it!

  • @ashok6644
    @ashok6644 Před 6 lety +3

    You are explained it clearly on Ride, Lasso and Elastic Net Regressions. and your teaching styles are awesome. Thanks Sir.

    • @bkrai
      @bkrai  Před 6 lety

      Thanks for comments!

  • @okolosundayojotule5484
    @okolosundayojotule5484 Před 3 lety +1

    This video is so helpful, I now have a glimpse of how to go about comparing Ridge, Lasso, and Elastic Net. Thank you so much Sir.

    • @bkrai
      @bkrai  Před 3 lety

      Thanks for your comments!

  • @cruisedog22
    @cruisedog22 Před 4 lety +1

    Thank you for this - question: how would you code to group your factor variables so that elastic net throws out or keeps all levels of the factor variable?

  • @samueljuma5905
    @samueljuma5905 Před 6 měsíci +1

    You just solved my of biggest problems in my article, THANK YOU!

    • @bkrai
      @bkrai  Před 6 měsíci

      You are welcome!

    • @samueljuma5905
      @samueljuma5905 Před 6 měsíci

      Please help at 23:43, what can I do so that xyplot() compares different models eg LASSO vs Ridge. Thanks!

  • @abhishekagnihotri9233
    @abhishekagnihotri9233 Před 6 lety +2

    Impresseive explanations Sir, I liked it too much....

    • @bkrai
      @bkrai  Před 6 lety

      Thanks for comments!

  • @shadyjii2154
    @shadyjii2154 Před 4 lety +2

    You are a legend, this was super helpful.

    • @bkrai
      @bkrai  Před 4 lety +1

      Thanks for comments!

  • @ramchandersrivastava6352
    @ramchandersrivastava6352 Před 5 lety +2

    u would definitely work so hard for all this, hats off to you.

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @NextCR7Seb
    @NextCR7Seb Před 3 lety +1

    You're the real MVP! thanks alot for sharing this

    • @bkrai
      @bkrai  Před 3 lety

      You are welcome!

  • @ramchandersrivastava6352
    @ramchandersrivastava6352 Před 5 lety +1

    Dear Sir, in your videos u make our life so simple and save no of hr's.

    • @bkrai
      @bkrai  Před 5 lety

      Good to know it helps save time!

  • @xuxiaoliu8113
    @xuxiaoliu8113 Před 5 lety +1

    so good!!!! the video helps a lot! my first comment on CZcams. thank you very much!

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @kalyanasundaramsp8267
    @kalyanasundaramsp8267 Před 5 lety +1

    excellent sir..pls continue posting videos

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @send2milan
    @send2milan Před 5 lety +1

    Thank you sir. I expect more of your videos in youTube.

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for the comments! You can find some useful links below:
      Introductory R Videos: goo.gl/NZ55SJ
      Machine Learning videos: goo.gl/WHHqWP
      Deep Learning with TensorFlow: goo.gl/5VtSuC
      Image Analysis & Classification: goo.gl/Md3fMi
      Text mining: goo.gl/7FJGmd
      Data Visualization: goo.gl/Q7Q2A8

  • @mandava5103
    @mandava5103 Před 5 lety

    Thanks for the video Prof. Rai. I have a couple of questions: What is finalModel, You have set lambda between 0.001 and 1. However I see large log lambda values in the plot. How to explain this? Thanks

  • @parasrai145
    @parasrai145 Před 6 lety +1

    Very well explained.

    • @bkrai
      @bkrai  Před 6 lety

      Thanks for comments!

  • @varunamal
    @varunamal Před 4 lety +1

    Very informative. Thank you.

    • @bkrai
      @bkrai  Před 4 lety

      You are welcome!

  • @lelabachiashvili2107
    @lelabachiashvili2107 Před 5 lety +1

    many thanks, one of the helpful videos

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @John-dw6jb
    @John-dw6jb Před 3 lety +1

    Amazing tutorial. Thank you very much, I just subscribed to your channel.

    • @bkrai
      @bkrai  Před 3 lety

      Thanks and welcome!

    • @John-dw6jb
      @John-dw6jb Před 3 lety +1

      @@bkrai I am a graduate student currently doing a research project with sg-LASSO and your video really helped me. Thanks again.

    • @bkrai
      @bkrai  Před 3 lety

      Thanks for comments!

  • @user-jc9nv6lj9u
    @user-jc9nv6lj9u Před 5 lety +1

    Excellent video.

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @yuanjunlu9219
    @yuanjunlu9219 Před 5 lety +1

    Love U so much. This video help me a lot

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @alifmaulida4475
    @alifmaulida4475 Před 2 lety

    thank you for your video, very help, i've got a question, how about SEE for penalized spline regression? what is the different with ridge regression?
    thanks in advance

  • @dilshadkhanum6953
    @dilshadkhanum6953 Před 5 lety +1

    Thank you so much for explaining in such simple and efficient way. Does Ridge/Lasso/Elastic Net fall into the dummy variable tarp ? I have a data set where I have created dummy variables for categorical variables, and then aggregated them. Can I use all of them in these methods?

    • @bkrai
      @bkrai  Před 5 lety

      Yes, that should work fine.

  • @mehmetfatihyildirim3449
    @mehmetfatihyildirim3449 Před 4 lety +1

    Thank you for a great tutorial, Dr. Bharatendra Rai! I wonder how you handled the categorical variable. Did you put into the LASSO model as numeric or factor?

    • @bkrai
      @bkrai  Před 3 lety

      Note that chas is a factor variable in this example.

  • @angelali6437
    @angelali6437 Před rokem

    Thanks for the great tutorial! Would anyone know why coef(ridge) returns many coefficients for each predictor? Thanks

  • @melissanichol4051
    @melissanichol4051 Před 5 lety +1

    Thanks for a fantastic video. I have run this tutorial without issue with Boston data set. I am replicating this with my own current data set of 10 variables with 226 observations. When running lasso and elastic net I keep getting this error "In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, :
    There were missing values in resampled performance measures." However I have no missing data within the data set. Any thoughts? Thank you.

    • @bkrai
      @bkrai  Před 3 lety

      I saw this today, probably you already solved this problem.

  • @Yllemanden
    @Yllemanden Před 5 lety +2

    Thank you for this nice explanatory video. However, I do have one question. In the end, you end up with some variables having the highest coefficients, i.e. the ones explaining the outcome data the best. But how do you determine a cut-off ? In your case "nox" and "rm" have higher coefficients than most making them the easy choice. But what if you have some that are closer together etc. Do you not use variables that have coefficients lower than 1 (higher than -1), or how do you actually pick the right variables, and the correct amount none the less, instead of ending up with 10 variables for your model.

    • @akshaytakhi8016
      @akshaytakhi8016 Před 4 lety +1

      please reply on this sir

    • @bkrai
      @bkrai  Před 3 lety +1

      We don't need to pick variable as feature selection happens automatically here.

    • @bkrai
      @bkrai  Před 3 lety +1

      I saw your comment today.

  • @AkshatJha
    @AkshatJha Před rokem +1

    Thanks for the video. For Lasso and Elastic Net, shouldn't we scale the data before running the model?

    • @bkrai
      @bkrai  Před rokem

      That's always a good idea.

  • @kylmaz5782
    @kylmaz5782 Před 11 měsíci

    Hello. I want to implement the ridge regression method on a small dataset. but I want to get it by solving the model manually (by hand). How can I do it? I will be glad if you can help.

  • @rohitnath5545
    @rohitnath5545 Před 2 lety

    can we have an example of multiple factor level categories in the model and see how elastic net works. will it keep insignificant factor levels or drop them off as they are insignificant

  • @abc_def789
    @abc_def789 Před 3 lety

    Sir I want to ask about the sequence, when in ridge regression you set the sequence as 0.0001 to 1 with length 5, for this sequence I got the lambda= 0.00001, when I changed the sequence to 0.001 to 1, my lambda also changed.
    Can you please tell me what lambda should I select?

  • @adriennewelch5891
    @adriennewelch5891 Před 4 lety +3

    Hi, thanks for nice video tutoial. one of the best. I wanted to go over your tutorial. Unfortunately, I also being stopped at Ridge. I got the same problem over there: > ridge

    • @jarrelldunson
      @jarrelldunson Před 4 lety

      getting the same error... is there a solutution?

    • @bkrai
      @bkrai  Před 4 lety

      I don't see any error. Probably you can delete code, and rewrite as sometimes it is something small that we may miss.

  • @farygreenart
    @farygreenart Před 5 lety +1

    Thanks thousands for useful video . I have a question about "Error in plot.new() : figure margins too large " after running pairs.panels(Data[c(-2, -55)]) . I have 55 factors and 57686 observation . it can handle this up to limited number of factors?

    • @bkrai
      @bkrai  Před 5 lety

      You can try with smaller number of variables. With 55 variables, even if plot is made, it will be difficult to see patterns.

  • @jubayerbiswas1356
    @jubayerbiswas1356 Před 4 lety +1

    Thank you for your excellent and informative lecture. I want to ask one question that I am facing in recently. I am trying quantile regression with LASSO penalty. Is it possible to use the “train” function by changing method and tuneGrid ? If not then what will be the solution ? would you please make video on quantile regression with LASSO penalty.

    • @bkrai
      @bkrai  Před 4 lety +2

      Thanks, I've added this to my list.

  • @rolandkouakou9235
    @rolandkouakou9235 Před 5 lety +1

    Thanks Mr Rai

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @davidli2294
    @davidli2294 Před 4 lety +1

    Thank you thank you so much . Can I ask is it the same testing for for logistic model ?

    • @bkrai
      @bkrai  Před 4 lety

      In logistic model response is a factor variable. So these two situations are different.

  • @abdinardooliveira9109
    @abdinardooliveira9109 Před 5 lety +1

    Hello, I am trying to run your algorithm but when I tried to run the linear model (7:53) it fails, showing the following message: predictions failed for Fold01.Rep1: intercept=TRUE Error : $ operator is invalid for atomic vectors. How can I solve this? Thank you! PS: Nevermind...I could solve this by myself: it is just reset R. I worked now. Anyway, thanks!

    • @bkrai
      @bkrai  Před 5 lety +1

      Thanks for the update!

  • @optoed
    @optoed Před 6 lety

    Dear Bharatendra, thank you a lot for the bright explanation! I would like to ask you how can I get p-values for coefficients from elastic net? Thank you in advance!

    • @jwck7
      @jwck7 Před 5 lety

      it's not simple, and is a somewhat new area of research. usually you don't worry about it, after all the only reason you see the variables is because the elastic net procedure decided they should be kept, remember?

  • @FarooqiA1
    @FarooqiA1 Před 4 lety

    Very Nice. Are the lambdas in SS's not different?

  • @aleksandrpugachev1035
    @aleksandrpugachev1035 Před 2 lety +1

    Thank you for clear and simple explanations. After you use Elastic to predict, how do you interpret your results? Please provide more explanation ex. prediction on train is 4.11 and on test is 6.15. What does this actually tell us?

    • @bkrai
      @bkrai  Před 2 lety

      Those are root mean square error (RMSE) values that tell us how accurate our model is. Lower values of RMSE indicates better prediction performance by the model.

  • @adityapatnaik7078
    @adityapatnaik7078 Před 6 lety +1

    excellent work! cud you plz make a video to check for assumptions of linear regressions

    • @bkrai
      @bkrai  Před 6 lety

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

  • @SaveSoilSaveSoil
    @SaveSoilSaveSoil Před 3 lety +1

    Thank you Dr. Rai. This was helpful. Do you know how to alter the selection criterion (e.g., to aic, bic, sbc, etc.) by any chance?

    • @bkrai
      @bkrai  Před 3 lety

      See if this helps: www.methodology.psu.edu/resources/AIC-vs-BIC/

    • @SaveSoilSaveSoil
      @SaveSoilSaveSoil Před 3 lety +1

      Thank you very much Dr. Rai. I posted my question in the link below. I am leaving a record here in case anyone has the same question.
      stats.stackexchange.com/questions/502356/lasso-regression-with-aic-or-bic-as-model-selection-criterion

    • @bkrai
      @bkrai  Před 3 lety

      You are welcome!

  • @kalyanasundaramsp8267
    @kalyanasundaramsp8267 Před 6 lety +1

    thanks so much sir. when we have the target variable as classification(0 or 1),will the same approach work?

  • @anthonysun2193
    @anthonysun2193 Před 3 lety +1

    Thank you for the video, Dr. Rai.
    Does anyone know how to make the font size on the label larger in the plot? It is extremely small. I searched online and tried for a while, but cannot get it done. Also, how about adding legend to the plot?

    • @bkrai
      @bkrai  Před 3 lety

      To change font size you can use 'cex'.

    • @anthonysun2193
      @anthonysun2193 Před 3 lety

      @@bkrai
      Thank you for your reply, Dr. Rai. I tried to use cex, but none of the methods change the size of the label on the lines. (I only know of cex.axis, cex.lab, cex.main, and cex.sub, and none of them work in this case.)
      - Anthony

    • @anthonysun2193
      @anthonysun2193 Před 3 lety

      @@bkrai
      Also, in the plots (log lambda vs. Coeff and Fraction Deviance Explained vs. Coeff), they showed that variable 6 is better than variable 5 as Variable 6 is not overfitted. What are Var(5) and Var(6)? Are Var(5), nox, and Var(6), rm? But based on the importance order, nox is much more important than rm, so did I get the number /variables order messed up?

  • @abhinavmishra7786
    @abhinavmishra7786 Před 6 lety +2

    Hi Sir, really a very helpful interpretations of outcomes for lasso ridge and elasticnet. I have a doubt, can we apply ridge, lasso and elasticnet on classification problem??

    • @bkrai
      @bkrai  Před 6 lety

      Yes, they can be used for classification problems too.

    • @abhinavmishra7786
      @abhinavmishra7786 Před 6 lety +1

      Hi sir, Thanks a lot for replying... I am practicing on churn analysis data with logistic regression. I request you to please guide us with a video demonstrating the customer life time value analysis on R and how and where it is used

    • @bkrai
      @bkrai  Před 6 lety +1

      I've added this to list of future videos.

    • @abhinavmishra7786
      @abhinavmishra7786 Před 6 lety

      Thank u sir..

  • @Dejia_Space
    @Dejia_Space Před 4 lety +1

    Dr. Rai
    After I run the following code
    ridge

    • @bkrai
      @bkrai  Před 3 lety

      You can try that and see if it helps to improve the model.

    • @abc_def789
      @abc_def789 Před 3 lety

      Isn't value of lambda supposed to be between 0 and 1 if you're using the values in sequence?

  • @humawaleed7489
    @humawaleed7489 Před měsícem +1

    hats off sir

  • @me3jab1
    @me3jab1 Před 4 lety +1

    wow Thank you Boss

    • @bkrai
      @bkrai  Před 4 lety

      Thanks for comments!

  • @sandysanju9675
    @sandysanju9675 Před 4 lety +1

    This is an excellent explanation sir, hats off to you. sir I have a query, could you please tell me how can I use the ridge, lasso and elastic net regression for unbalanced panel data... looking for your help.. kindly tell me the source also for the panel data ridge, lasso and elastic net regression...

    • @bkrai
      @bkrai  Před 4 lety

      For class imbalance problem, you may find following useful:
      czcams.com/video/Ho2Klvzjegg/video.html

    • @sandysanju9675
      @sandysanju9675 Před 4 lety

      Sir my data is in the form of Yit= a +bXit+ eit
      where i is the number of firm and t is the time period.
      i have collected the data for n firms over period 0f Time t. i mean i have collected the data for
      each firm for t period. now my problem is i have several explanatory variables therefore i want to
      use normalisation for variable selection and inference for imbalanced panel data kindly help me.
      @@bkrai

  • @dobariyahardik3388
    @dobariyahardik3388 Před 2 lety +1

    thanks allot sir

    • @bkrai
      @bkrai  Před 2 lety

      You are welcome!

  • @99chintu
    @99chintu Před 5 lety +1

    Sir.. you did not performed any standardization on data before running the alogrithm. Is standardization required or not before running this techniques.

    • @bkrai
      @bkrai  Před 3 lety

      Not required here but even if you do it, should be fine.

  • @kalyanasundaramsp8267
    @kalyanasundaramsp8267 Před 6 lety

    also when the dependent variables are discrete, can we convert them to factors and apply the same approach

    • @bkrai
      @bkrai  Před 6 lety

      You need logistic regression for discrete target variable.

    • @kalyanasundaramsp8267
      @kalyanasundaramsp8267 Před 6 lety

      sorry sir am asking lot of questions, in my case am having lot of independent variables that are factors and would like to crunch them in to few to make it simple. in my case target variable is "yes" or "no".glmnet function in R says it also supports binomial.

  • @drvishalsrivastava2331
    @drvishalsrivastava2331 Před 5 lety +1

    Amazing

  • @subaganesh552
    @subaganesh552 Před 5 lety +1

    Sir, Will you make sequential feature selection algorithm in r...

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for the suggestion, I've added this to my list. For feature selection you can also refer to this:
      czcams.com/video/VEBax2WMbEA/video.html

  • @tomishrabarua9168
    @tomishrabarua9168 Před 3 lety +1

    Hello sir
    For my dataset i am getting same lower RMSE and same higher Rsquared value for lasso and elastic net methods...how can i choose better algo from these two?

    • @bkrai
      @bkrai  Před 3 lety +1

      You can choose whichever is simpler.

  • @anabruhn
    @anabruhn Před 2 lety

    What if I wanted the programm to define the best valeu for lambda? I mean, without me putting a sequence in the code

  • @kartikjha5704
    @kartikjha5704 Před 2 lety +1

    Sir, If independent variables are highly correlated in classification problems than also we should use these types of procedures or we can ignore that. Kindly help

    • @bkrai
      @bkrai  Před 2 lety +1

      For classification problems, try this:
      czcams.com/video/hCLKMiZBTrU/video.html

    • @kartikjha5704
      @kartikjha5704 Před 2 lety +1

      @@bkrai Thank you sir. Your videos helped me a lot in learning ML and R coding. Thanks a lot sir again.

    • @bkrai
      @bkrai  Před 2 lety

      You are welcome!

  • @chubathien9
    @chubathien9 Před 2 lety

    What if my lambda = 1? Is it an issue with my model and CV?

  • @jvickers1879
    @jvickers1879 Před 3 lety +1

    When doing the scatterplot, why eliminate the target variable? Isn't helpful to see what variables are, and aren't, correlated to it?

    • @bkrai
      @bkrai  Před 3 lety

      It was mainly for discussing multicollinearity where target variable is not needed.

  • @wert572
    @wert572 Před 3 lety +2

    Sir, can you do a tutorial for using glmnet package for doing logistic regression.

    • @bkrai
      @bkrai  Před 3 lety +1

      Thanks, I've added it to my list of future videos. Meanwhile you may also refer to this:
      czcams.com/video/AVx7Wc1CQ7Y/video.html

  • @laiqashafique569
    @laiqashafique569 Před 6 lety +1

    sir kindly tell me if we don,t want partitioning of data can we omit that part why we use train word in each model

    • @bkrai
      @bkrai  Před 6 lety

      It is always a good idea to partition data to avoid over-fitting. "train" is the function used for developing a model, that's why we need to use it.

    • @laiqashafique569
      @laiqashafique569 Před 6 lety

      thanks for ur reply but when i run ur program i got lots of errors

    • @laiqashafique569
      @laiqashafique569 Před 6 lety

      sir waiting for your video on multi level regression by using lasso and rigid regression

    • @bkrai
      @bkrai  Před 6 lety

      I would suggest first try same data that is used in the video. That will make sure codes have no error.

  • @andresbaron8557
    @andresbaron8557 Před 3 lety +1

    How do you find the final equation of the regression ? and the confusion matrix ?

    • @bkrai
      @bkrai  Před 3 lety

      Line-95 gives intercept and coefficients for the model. In regression problems, confusion matrix is not required. You can use RMSE or R-square.

  • @ainaumairahmazlan2029
    @ainaumairahmazlan2029 Před 3 lety +1

    Sir, i do have a question can this method apply to gene expression dataset for feature selection?

    • @bkrai
      @bkrai  Před 3 lety +2

      I'll have to look at the data to make suggestion.

    • @ainaumairahmazlan2029
      @ainaumairahmazlan2029 Před 3 lety +1

      @@bkrai the data usually contains small sample and hundred to thousands of gene variable Sir.

    • @bkrai
      @bkrai  Před 3 lety +2

      You can follow the steps in the video and let me know if there is any issue. You can also try:
      czcams.com/video/VEBax2WMbEA/video.html

    • @ainaumairahmazlan2029
      @ainaumairahmazlan2029 Před 3 lety +1

      @@bkrai I will do. tqvm Sir 😊

    • @bkrai
      @bkrai  Před 3 lety

      Welcome!

  • @praveenk9237
    @praveenk9237 Před 4 lety +2

    Thanks a lot for the tutorial Sir. Really helpful.Just a small question though.
    Is there a code that i can use to see the P value of the regression equation also also along with the R squared and RMSE values?

    • @bkrai
      @bkrai  Před 3 lety

      The output includes all of them.

  • @prarthanawajpai5180
    @prarthanawajpai5180 Před 4 lety +1

    Thankyou for sharing this knowledge sir.
    I am having some errror.Follwing is the code and error
    airglasso

    • @prarthanawajpai5180
      @prarthanawajpai5180 Před 4 lety

      Please helpout sir

    • @bkrai
      @bkrai  Před 4 lety

      I see you have used "

    • @bkrai
      @bkrai  Před 4 lety

      There is a typo in the code.

    • @prarthanawajpai5180
      @prarthanawajpai5180 Před 4 lety +1

      @@bkrai Its the typo while copypasting code over here sir.Even after that correction i getting same error

    • @bkrai
      @bkrai  Před 4 lety

      Share your code so that I can take a look

  • @chriss7771
    @chriss7771 Před 5 lety +1

    Is there any way you could do a video on caret ensamble?

    • @bkrai
      @bkrai  Před 5 lety

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

    • @chriss7771
      @chriss7771 Před 5 lety

      @@bkrai Thank you sir.

  • @hans11996
    @hans11996 Před 5 lety +2

    Dear sir,
    Please on below error i am getting while getting same code-
    set.seed(1234)
    ridge

    • @bkrai
      @bkrai  Před 5 lety

      Looks like your data has missing values which is causing this error.

  • @amgdhussein7040
    @amgdhussein7040 Před 2 lety +1

    In this code, the train function is regressing against all data which doesnt allow for any feature engineering. can anyone clarify ?

    • @bkrai
      @bkrai  Před 2 lety

      The methodology takes care of that.

  • @jwck7
    @jwck7 Před 5 lety +1

    20:40 you say the purple variable (#6) is more important than blue (#5), but this always disagrees with the variable importance plots, which say nox (variable 5) is most important with rm (variable 6) the second most important. Did you mean to say the blue line was more important? You also say this at16:58

    • @bkrai
      @bkrai  Před 5 lety

      You are right, nox is contributing more to the model.

    • @jwck7
      @jwck7 Před 5 lety +1

      Okay thanks. Great video by the way there's a lot of great stuff in here in addition to what's in the title so thanks for making it, you're also the only person I've seen who speeds up the code writing portions instead of putting us to sleep to the sound of the keyboard slowly typing code so that was a smart touch too :)

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for feedback!

  • @sandysanju9675
    @sandysanju9675 Před 3 lety +1

    Sir I have got this problem and i have checked my each value i do not have any missing value plz help
    Error in na.fail.default(list(LTDA = c(0.26683158, 0.37309602, 0.40553323, :
    missing values in object

    • @bkrai
      @bkrai  Před 3 lety

      Look at summary of data using 'summary' function. If there is missing data, it will show up as NAs.

    • @sandysanju9675
      @sandysanju9675 Před 3 lety

      @@bkrai Sir, I have seen through summary but it shows no missing data

    • @sandysanju9675
      @sandysanju9675 Před 3 lety

      lm

    • @sandysanju9675
      @sandysanju9675 Před 3 lety

      Sir please help

    • @sandysanju9675
      @sandysanju9675 Před 3 lety

      Sir I have checked my summary statistics but i did not found any missing value

  • @mabelezeonugo5023
    @mabelezeonugo5023 Před 3 lety +1

    Getting an error when trying to run my prediction and my dependent variable is a factor

    • @bkrai
      @bkrai  Před 3 lety +1

      For factor type dependent variable, try this:
      czcams.com/play/PL34t5iLfZddvv-L5iFFpd_P1jy_7ElWMG.html

    • @mabelezeonugo5023
      @mabelezeonugo5023 Před 3 lety

      @@bkrai thank you Sir, is it possible to get the confusion matrix showing the F1-score

  • @yogitasolanki4638
    @yogitasolanki4638 Před 5 lety +1

    Accuracy kese chk karenge sir

  • @hhangjohn75
    @hhangjohn75 Před 4 lety +1

    i stopped at ridge step, it shows Error: Stopping
    In addition: There were 26 warnings (use warnings() to see them)
    DAMNNNNNNN

    • @bkrai
      @bkrai  Před 4 lety

      If you are already using the R code that I provided in the description area, then I'll suggest review the code as it may be a small error. Also check if you have missing data.

    • @okan702
      @okan702 Před 4 lety

      @@bkrai Sir the code you provided has some missing data. I tried to fill by looking at your video but it doesn't work. Can you share the exact code in this video? Thank you

  • @sudheersk5727
    @sudheersk5727 Před 5 lety +1

    Hi sir can you please tell me your mail id, i have a one problem statement, i need to know your suggestion on that dataset.

    • @bkrai
      @bkrai  Před 3 lety

      seemabharat@gmail.com

  • @ammar46
    @ammar46 Před 3 lety +1

    I get less RMSE for test data😂

    • @bkrai
      @bkrai  Před 3 lety

      It can happen sometimes, but mostly it is the other way.