Deep Neural Networks with TensorFlow & Keras in R | Numeric Response Variable

Sdílet
Vložit
  • čas přidán 30. 05. 2024
  • Provides steps for applying deep neural networks for numeric response or independent variable.
    R file: goo.gl/MwBLVt
    Machine Learning videos: goo.gl/WHHqWP
    For citation as reference in a research paper, use:
    Reference: Rai BK, (2019). “Advanced Deep Learning with R: Become an expert at designing, building, and improving advanced neural network models using R”, Packt Publishing.
    Timestamps:
    00:00 Introduction
    01:46 Neural Network Visualizations
    03:44 Matrix conversion and Data Partition
    05:13 Normalize
    06:24 Create Model
    07:44 Compile
    08:15 Fit Model
    09:45 Evaluate
    11:21 Fine Tune Model
    14:04 Improvements
    Deep learning with neural networks is an important 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.

Komentáře • 222

  • @muhyideanaltarawneh7287
    @muhyideanaltarawneh7287 Před 5 lety +7

    One of the best tutorials I ever watched, Thank you so much, you are awesome!

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for your comments and feedback!

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

    Dr. Rai I wish to thank you deeply for these easy explanations about NN. Again thank you very much

    • @bkrai
      @bkrai  Před 3 lety

      You are most welcome!

  • @jean-lucfanny4210
    @jean-lucfanny4210 Před 4 lety +1

    Your videos are amazing. Thank you for exposing us to your knowledge.

    • @bkrai
      @bkrai  Před 4 lety

      Thanks for comments!

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

    Fantastic video. Thank you so much Dr Rai.

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for your comments!

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

    You just made my work easier, thank you very much indeed!

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

      Glad to hear that!

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

    Recently found your video's. Thank you so much for doing these, they are clear and thorough. You sir are my new best friend.. :)

    • @bkrai
      @bkrai  Před 3 lety

      Welcome aboard!

  • @Booggie7
    @Booggie7 Před 6 lety +17

    Thank you, I've learned a lot watching your videos ! Please can you do a tutorial to build a recurrent neural network (RNN) on R for data prediction ? An LSTM/GRU one would be awesome !

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

      Thanks for the suggestion. I'm seeing this very late, but it should happen in about a month.

    • @Booggie7
      @Booggie7 Před 3 lety

      @@bkrai Thank you Sir !

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

    Thank you so much, this helped me a lot! You explained everything really well

    • @bkrai
      @bkrai  Před 3 lety

      You're very welcome!

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

    Dear Rai,You have made a series of outstanding deep learning videos, which helped me a lot. Thank you for your contribution and look forward to your more instructional videos on deep learning ( Long short-term memory network)

    • @bkrai
      @bkrai  Před 3 lety

      Thanks! I'll soon do LSTM too.

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

      @@bkrai Looking forward to your next video

    • @bkrai
      @bkrai  Před 3 lety

      Thanks!

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

    Very useful and very well explained!

    • @bkrai
      @bkrai  Před 6 lety

      Thanks for comments!

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

    Simple language u explained sir.Thank you for making video

    • @bkrai
      @bkrai  Před 2 lety

      You are most welcome!

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

    Thank you so much, you actually helped me sir. LOVE YOU !!!!!

    • @bkrai
      @bkrai  Před 3 lety

      Thanks for comments!

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

    Great video as usual. As time permits love to see a video on AutoEncoders. Thank you

    • @bkrai
      @bkrai  Před 6 lety

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

  • @BuildInAmerica
    @BuildInAmerica Před 5 lety

    Great video, thank you. I am having problem un-scaling the prediction value using unscale function (Error: Error in scale.default(data, center = FALSE, scale = 1/scale) : length of 'scale' must equal the number of columns of 'x'). Is there a way to unscale with keras function or some other way?

  • @mehdi1270
    @mehdi1270 Před 3 lety

    Thank you very much Dr. Rai for your informative videos. Your tutorials are like compressed 3 months of work in 20 minutes!!! Is there a chance you could post a multivariate forecasting and tuning example with LSTM.

  • @thejll
    @thejll Před rokem

    Thank you for a very clear and interesting video! About overfitting: should you stop when train and test error curves cross or can you keep training? What if both errors are still decreasing with continued iteration? Is the danger of over fitting mainly in thinking the training error is valid for the model applied to new data?

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

    thank you for this helpful tuto and please we need more tuto for using keras in deep leruning for regression case

    • @bkrai
      @bkrai  Před 5 lety

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

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

    you rock, Dr. Rai.

  • @Rossboe1
    @Rossboe1 Před 3 lety

    Hi, thanks for the great tutorials. Can this model be used with and ordinal dependent variable. Like a horse race first, second, third, lose?
    Thanks again.

  • @rexvm
    @rexvm Před rokem +1

    I'm digging the music professor!

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

    One of the best and simple explanation of DNN. Can you please make a tutorial on time series forecasting using a combination of DL models such as CNN-LSTM?

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

      Thanks, I've added it to my list.

  • @vishnukirant4025
    @vishnukirant4025 Před rokem

    Thank you for great explanation, could you help me with this error in model creation
    model1

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

    Great video as always. Does this model produce a linear equation (similar to lm.fit) that can be extracted out?

    • @bkrai
      @bkrai  Před 6 lety

      For calculations with a simple example, you may refer to this link:
      czcams.com/video/-Vs9Vae2KI0/video.html

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

    All your videos are very informative and everything is so well explained. I have been working on time series data. Your video on facebook's prophet library was amazing, although prophet only works well on an ideal dataset. I have a request sir, please do a tutorial for time series forecasting using lstm in R, would be really helpful

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

      Thanks for comments and suggestion! I've added it to my list.

  • @hapvideolar7957
    @hapvideolar7957 Před rokem

    Sir, I need to calculate rsquared value of the model. How can I get the r squared or accurate ration?

  • @waelbadawy2857
    @waelbadawy2857 Před rokem

    Dear Dr. Rai. thanks a lot for your informative video. I am trying to install keras in r on Mac Pro M1 . but it does not work and gives a fatal error each e=time I run the code. I used your video as an examples for my data. may I ask you if you have a step by step install and configure keras and tensforflow on Mac Pro M1?
    Thanks in advance!

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

    Great Video. Question: In the other video you used the min max normalization, would it work here too? How do I know which normalization method to use? Thanks

    • @bkrai
      @bkrai  Před 4 lety

      It is important to do normalization. However there may not be much difference when it comes to model performance. So any one of the 2 methods will work fine.

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

    Am curious, when you applied the training's mean and sd for the Test's centre and scale, are'nt you introducing data leakage in this case?

    • @bkrai
      @bkrai  Před 6 lety

      This will minimize data leakage.

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

    Hi sir, thanks for your videos.
    May I ask you why you set to NULL (ie V1, V2 etc) the names of the columns?
    Thanks.

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

      I wanted to have simple variable names such as V1, V2, .. etc.

  • @dr.lakshmananravi9708
    @dr.lakshmananravi9708 Před 11 měsíci

    Prof., understood the principles. Excellent lecture. Could you please let us know how to use the selected model for forecasted vales for future period. Regards

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

    Dr Rai, Thankyou very much for sharing your knowledge & educating the data science professionals,
    quick question, What would be your recommendation for saving trained Model & exporting to other machines , formats
    Something like JSON, or XML, Or CSV (more generic), or do we need to stick to just '.RDS' ?

    • @bkrai
      @bkrai  Před 3 lety

      RDS should work fine.

  • @JackDaniels-ei1ds
    @JackDaniels-ei1ds Před 5 lety +1

    Nice job. Clean and crisp!

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

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

    Also, curious when calling Tensorflow from Keras R, is it running inside R memory space or is it running in its own memory space / remote machine? Thank you...

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

      It runs inside R.

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

    Great Video!
    Are there any current ways to plot the Keras model similar to how the neural net package plotted the original node map? I've been doing some research on this, and I'm coming up empty handed.

    • @bkrai
      @bkrai  Před 3 lety

      I'll look into this.

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

    Awesome video. Thank you. Two quick questions
    1. Curious why you remove all the column names?
    2. For converting chas shouldn't you be creating two columns using to_categorical(...) similar to what you did in one of your previous videos?
    Thank you

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

      1. This is not mandatory. I had done this for other purpose and kept the same code for this example.
      2. Chas has only 2 levels, so one column with 0 and 1 values is fine here. We can use that earlier method when a factor variable has more levels.

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

    Thank you so much for your useful tutorials. A quick question how we can obtain an exactly same result for the same model after running several times. I tried with (set.seed(1234)) but the results were different. Could you provide any suggestion for that?

    • @bkrai
      @bkrai  Před 3 lety

      It is a bit complex process. It will be easier to simply save the model.

  • @blackstars7191
    @blackstars7191 Před 2 měsíci

    I have a problem when I try to run the model at 7:40. The error says : Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
    ValueError: Only input tensors may be passed as positional arguments. The following argument value should be passed as a keyword argument: (of type )
    Run `reticulate::py_last_error()` for details.
    Can you help me ?

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

    It was a very good explanation

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for comments!

  • @engr.abdullahazzamsafi4515

    Dear Professor. My question is that Why every time the model gives different performance results without changing any parameters in the model?

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

    I am curious why you choose Adam versus RMSPROPS. Also for the learning rate, is there any guidance on how to pick the learning rate? Thank you for your help.

    • @bkrai
      @bkrai  Před 5 lety

      It may be better to try both. For learning rate, it is better to start with a lower value and gradually increase to find the best level.

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

    Thank you very much, this is very clear and helpful. Do you maybe also have a similar tutorial related to the one with multiple numeric responses?

    • @bkrai
      @bkrai  Před 2 lety

      I've added it to my list. Thanks!

  • @AnantaPradhan
    @AnantaPradhan Před 3 lety

    Could you explain how to run dNN using raster data?

  • @sudhakarsingha283
    @sudhakarsingha283 Před 4 lety

    Thank you sir for your nice video about deep learning method. Kindly suggest how to extract the k-fold 'cv' results. It will be very much helpful for better presentation of results. Kindly suggest Sir

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

    Thank you. I have learned a lot from this video.
    by the way, how can I reproduce the result of the neural network every time I run the model?
    Thank you so much.

    • @bkrai
      @bkrai  Před 4 lety

      That’s a bit complicated. It is suggested to run a model several times and then take average of results.

    • @chandradeepsingh.8661
      @chandradeepsingh.8661 Před 3 lety

      .it's backpropogation neural network which becomes more acurate and smarter every time we train it

  • @muratgenc2424
    @muratgenc2424 Před rokem +1

    Thank you for the video. If the factor variable has more than two levels, will we use dummy coding or something else?

    • @bkrai
      @bkrai  Před rokem

      You can refer to this example where response has 3 levels:
      czcams.com/video/4KfiQRqn_vA/video.html

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

    Thank yoy very much Dr. Rai , I am getting this message "your cpu supports instructions that this tensorflow binary was not compiled to use avx2" can you please help me ?

    • @bkrai
      @bkrai  Před 4 lety

      It could be a computer specific issue. You can try rstudio cloud:
      czcams.com/video/SFpzr21Pavg/video.html

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

    Thank you very much for such a nice tutorial. I have a question though, I want to make a neural network with custom connections between the neurons of the input and hidden layers, how to do that ? Basically, I am trying to apply prior knowledge to the neural net architecture and remove all those connections that do not satisfy the particular conditions. Please indicate a source or any other tutorial where I can find something like this. Many thanks in advance.

    • @bkrai
      @bkrai  Před 3 lety

      See if this helps:
      www.r-bloggers.com/2020/07/creating-custom-neural-networks-with-nnlib2rcpp/

  • @user-mp9py5dq2w
    @user-mp9py5dq2w Před 11 měsíci +1

    Thank you very much! I learned a lot from this video.
    By the way, how do I choose the number of hidden layers before running the model each time?
    Thank you very much.

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

      Hyperparameter tuning is needed. See link below:
      czcams.com/video/FscOZT0_ObA/video.html

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

    Thank you Sir, this video is very useful to me...Sir, in different datasets how can we know whether a variable is dependent or independent?

    • @bkrai
      @bkrai  Před 4 lety

      When you go over several examples, it will become more clear.

  • @user-jp7se5ch5t
    @user-jp7se5ch5t Před rokem +1

    Thank you for your video. Is there any reason using the command ' dimnames(data)

    • @bkrai
      @bkrai  Před rokem +1

      Just wanted to remove dimension names. But if it works without this line, you can ignore.

    • @user-jp7se5ch5t
      @user-jp7se5ch5t Před rokem +1

      @@bkrai Thank you for your reply😍

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

    Sir,
    very nicely explained tutorial..thanks.
    requested you to kindly make tutorial for multi target regression model in R-keras. in advance thanks.

    • @bkrai
      @bkrai  Před 3 lety

      Thanks, I've added it to my list.

  • @jean-lucfanny4210
    @jean-lucfanny4210 Před 4 lety +1

    Again Dr. Bharatendra, Do you know why I am getting an error when I am creating the model.
    Please, guide me otherwise I am can't go forward using this code
    "model %>%
    + layer_dense(units = 5, activation = 'relu', input_shape = c(13)) %>%
    + layer_dense(units = 1)
    Error in eval(lhs, parent, parent) : object 'model' not found"

    • @bkrai
      @bkrai  Před 4 lety

      The error is either in this or previous line of code.

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

    Hi!
    Congrats for the great video!
    Do you have any recommendation of packages to use in a recurrent neural network for classification purposes?
    If you have a tutorial for that it is going to be amazing!
    Thanks!

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

      I have added RNN to my list for future.

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

    when I execute the line model

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

      was there a fix? i am facing the same issue!

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

      There could be some computer specific issue. You can try RStudio cloud that runs from the browser,
      czcams.com/video/SFpzr21Pavg/video.html

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

      Try RStudio cloud that runs from the browser,
      czcams.com/video/SFpzr21Pavg/video.html

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

      install_keras()
      tensorflow::install_tensorflow(method = "conda",version = "2.0.0").

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

    How someone can get prediction value (dependent) for independent variable values with model for future? I think many newbies are wondering how to get an estimation after model is ok. Any help?

    • @bkrai
      @bkrai  Před 6 lety

      Line 68 in the video does prediction using the model and store the values in "pred".

    • @BuildInAmerica
      @BuildInAmerica Před 5 lety

      @@bkrai can you provide steps how to unscale.........having issues with unscaling using unscale() function

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

    Thx a lot 👍

    • @bkrai
      @bkrai  Před 2 lety

      You are welcome!

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

    This very interesting but complex process was simplified by this video. Easy to understand and replicate. What about forecasting? how does one forecast the prediction for future dates?

    • @bkrai
      @bkrai  Před 4 lety

      For forecasting deep learning network LSTM is very popular. Probably I'll do a lecture video on it some time.

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

      @@bkrai looking forward to it.

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

      Thanks!

  • @ramp2011
    @ramp2011 Před 6 lety

    Quick question, When does one use Tensorflow Estimator API for regression problems versus Keras? Thank you

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

      For key differences, see: tensorflow.rstudio.com/tensorflow/

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

    Please tell me what is the difference between the two method I.e one solved by neuralnet package and second with keras package.

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

      For deep networks go with keras as it will run much faster.

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

      @@bkrai I have install keras and tensorflow bit is not working
      install.packages("keras")
      install_keras()
      install.packages("tensorflow")
      install_tensorflow()
      miniconda package also installed .All library are also loaded
      But I am getting this error
      > model - keras_model_sequential()
      Error: Installation of TensorFlow not found. Python environments searched for 'tensorflow' package: C:\Users\User\AppData\Local
      -miniconcja\envs
      -reticulate\python.exe You can install TensorFlow using the install_tensorflow() function.

    • @bkrai
      @bkrai  Před 3 lety

      Refer to this link:
      czcams.com/video/-IYYqdxdYXk/video.html

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

    How did you get to c(10,5)? Is There a rule to find how many hídden layers and how many neurons per hidden layer?

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

      It needs experimentation. You can refer to this:
      czcams.com/video/FscOZT0_ObA/video.html

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

    Hi there, How do we inteprete the results of the prediction ? I am not sure I understood it well. Really good video btw. Thanks for sharing your knowledge.

    • @bkrai
      @bkrai  Před 2 lety

      You can refer to this series that has many examples:
      czcams.com/video/hd81EH1g1bE/video.html

  • @parthiban2800
    @parthiban2800 Před 5 lety

    when I execute this line, m

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

      make sure you run library(keras).

    • @immaculatesahai
      @immaculatesahai Před 4 lety

      @@bkrai ... i ran keras and am still facing the same issue

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

    Great tutorial Sir. After a long time you have uploaded a new video. Are you busy Sir? I have been waiting for your video for a long a time. Thank you so much for this one.

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

      Thanks for comments! You are right, this one took some time.

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

      How soon we can expect your new video Sir?

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

      Probably in a week or so.

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

      I'll be waiting for your next video Sir. This video took almost a month which is a very long period for all of us who eagerly wait to learn from you. Thank you so much Sir.

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

      It will be quicker this time.

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

    how to prediction future values?thank very much for your response

    • @bkrai
      @bkrai  Před 4 lety

      Future values can be part of data such as test data.

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

    Thanks for the video! Can you show me how to plot the neural net for recognition the digits?

    • @bkrai
      @bkrai  Před 4 lety

      Here is the link:
      czcams.com/video/5bso_5X7Zu4/video.html

  • @prasantbarla9263
    @prasantbarla9263 Před 4 měsíci

    it is asking to install python package for sequential analysis

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

    Thank you for Nice videoas on Neural Networks. I request for multivariate forecasting using Neural Networks in R. This would be helpful.

    • @bkrai
      @bkrai  Před 3 lety

      Thanks, I've added it to my list.

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

    Respect sir for all that you're doing here it makes a lot of differences.
    I'm wondering how I can deploy this exact model on a shiny app?

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

      I've added it to my list, thanks!

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

    Thank you very much Dr. Your videos are amazing as usual. Unfortunately, I can not use this technique to predict the prices of used cars since not all variables are numeric, so Deep NN will not work.

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

      to_categorical() function can be used to convert categorical variables to have integer values.

    • @netmarketer77
      @netmarketer77 Před 4 lety

      @@bkrai Ok .. Thank you very much.

  • @profach1
    @profach1 Před 5 lety

    thank you sir for the vedio plz i have i question when i create the model in R show me that Python module keras was not found.even that the library of keras works

    • @bkrai
      @bkrai  Před 5 lety

      did you run install_keras()?

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

      @@bkrai yes i do solve the problem by install tensorflow in code it work know but the problem in the evaluation i get big number 1234567 like this i don't know why? And thank you sir

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for the update!

    • @profach1
      @profach1 Před 5 lety

      @@bkrai in this case how to fix that to show that the loss increase ? that thank you sir

    • @bkrai
      @bkrai  Před 5 lety

      For that you need to experiement with different number of neurons and different hidden layers.

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

    Dear Sir, Thanks for good video. I am facing following error when, I am trying to excutse "keras_model_sequential()". Error: Installation of Python not found, Python bindings not loaded. Kindly guide me. Thanks

    • @bkrai
      @bkrai  Před 5 lety

      make sure keras is installed.

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

      @@bkrai I installed KERAS but when I execute then it is showing following error

    • @bkrai
      @bkrai  Před 5 lety

      I would suggest start with the 1st video in this playlist:
      czcams.com/play/PL34t5iLfZddtC6LqEfalIBhQGSZX77bOn.html

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

    Great Example but every time I try to fit the model I get the following error. I was wondering if you have insight. Again thanks for your amazing well articulated R training!
    Epoch 1/200
    Error in py_call_impl(callable, dots$args, dots$keywords) :
    ValueError: in user code:

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

      Never mind I figured it out! Thanks again for the amazing training!

    • @bkrai
      @bkrai  Před 3 lety

      Thanks for the update!

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

    Great Video. I am getting error in model

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

      Me too

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

      @@jitendraupadhyay6218 You guys need to have Python already installed on your computer. Then you may need restart your R studio and reinstall all required libraries. Or possible even reinstall R studio to make sure all connections are updated.

    • @bkrai
      @bkrai  Před 3 lety

      Thanks for the update!

  • @RahulSingh-ul6vv
    @RahulSingh-ul6vv Před 5 lety +1

    There are so many elements to tune the model and hence so many ways, how is one supposed to understand which element need to be modified, is it the extra hidden layer or number of neurons or the learning rate?

    • @bkrai
      @bkrai  Před 5 lety

      After some practice with different datasets, you will automatically start getting ideas as to what modification is likely to help.

    • @RahulSingh-ul6vv
      @RahulSingh-ul6vv Před 5 lety +1

      @@bkrai Thank you sir, I just have one last question and quite basic but I am still confused. In case of quantitative variable error is MSE for neural networks but in case of qualitative variable the data is in 0,1 format ans y_predicted is generally a probability value so what is the error that is calculated and propagated back to neurons through gradient descent for updating weights??

    • @bkrai
      @bkrai  Před 5 lety

      For qualitative variable we can make use of 'accuracy' which is higher the better.

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

    I have a question, how can I set the weight initialization at keras?

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

      It randomizes weights, each time you run model.

    • @ufcwolf4605
      @ufcwolf4605 Před 3 lety

      @@bkrai Thank you for your answer and your great video. But I have the following question: How can I fix the choice of weights in Keras? Perhaps there is a function like set.Sees () in Keras that. enables this?

    • @ufcwolf4605
      @ufcwolf4605 Před 3 lety

      I need this to compare which training starting point is better to determine.

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

    do you have convul+lstm tutorial vedio?

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

      You can find it in the book titled "Advanced Deep Learning with R" by me. But I'll certainly do a video in future.

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

      @@bkrai thank you!!! i will look it up!

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

    I wonder why you did not normalize the dependent variable "medv".

    • @bkrai
      @bkrai  Před 5 lety

      No harm in trying that.

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

    what is the purpose of neuralnet package when you have keras loaded?

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

      Just for the plot.

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

      @@bkrai Thank you for clarifying

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

    Thank you very much for this informative video,
    How can we use it for classification instead of regression?

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

      Many videos in this playlist are for classification:
      czcams.com/play/PL34t5iLfZddtC6LqEfalIBhQGSZX77bOn.html

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

      @@bkrai Thank you very much. Could you make a video for satellite image classification using neural nets?

    • @bkrai
      @bkrai  Před 3 lety

      Send me data that I can look at.

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

      @@bkrai Thanks a lot. Can I send it through email? Could I get a way to send it to you?

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

      seemabharat@gmail.com

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

    I am using rstudio cloud, but for some reason I get an error when I run the last bit of my code i.e Fit Model, would you be able to help where I may be missing it, here is the code and error >>
    model = keras_model_sequential()
    model %>% layer_dense(units = 5, activation = 'relu', input_shape = c(18)) %>%
    layer_dense(units = 1)
    #Compile
    model %>% compile(loss = 'mse', optimizer = 'rmsprop',
    metrics = 'mae')
    #Fit model
    mymodel = model %>% fit(training, trainingtarget, epochs = 50,
    batch_size = 10, validation_split = 0.2)
    Error
    Error in py_call_impl(callable, dots$args, dots$keywords) :
    ValueError: in user code:
    /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py:571 train_function *
    outputs = self.distribute_strategy.run(
    /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py:951 run **
    return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
    /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py:2290 call_for_each_replica
    return self._call_for_each_replica(fn, args, kwargs)
    /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages/tensorflow/python/distribute/distribute_lib.py:2649 _call_for_each_replica
    return fn(*args, **kwargs)
    /home/rstudio-user/.local/share/r-miniconda/envs/r-reticulate/lib/python3.6/site-pac
    Please assist. Thanks

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

      Have you tried this?
      czcams.com/video/-IYYqdxdYXk/video.html

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

      @@bkrai thanks much, will look at it.

    • @bkrai
      @bkrai  Před 3 lety

      welcome!

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

    Thanks so much!
    It will be great, if you can do autoencoders

    • @bkrai
      @bkrai  Před 5 lety

      Thanks for the suggestion!

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

    Should be the results uncaled? And if so how?

    • @bkrai
      @bkrai  Před 4 lety

      Target is not scaled, so you don't need to unscale.

    • @hansmeiser6078
      @hansmeiser6078 Před 4 lety

      @@bkrai It's seems my predictions are scaled (pred). Did I forgot something?

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

    Amen

  • @jean-lucfanny4210
    @jean-lucfanny4210 Před 4 lety +1

    When I used this piece of code I am getting this error from your own code and dataset. I didn't change anything. Do you know why? "> model %>%
    + layer_dense(units = 5, activation = 'relu', input_shape = c(13)) %>%
    + layer_dense(units = 1)
    Error in eval(lhs, parent, parent) : object 'model' not found" Thank you so much

    • @bkrai
      @bkrai  Před 4 lety

      It says "model" not found. Can you share this as well as previous line of code?

    • @jean-lucfanny4210
      @jean-lucfanny4210 Před 4 lety +1

      @@bkrai, Ok I am sharing the whole code previous and a preceding line of code after so that you see, Thank you so much for your answer. "# Libraries
      library(keras)
      library(mlbench)
      library(dplyr)
      library(magrittr)
      library(neuralnet)
      # Data
      data("BostonHousing")
      data

    • @bkrai
      @bkrai  Před 4 lety

      In your original message you had ">" before model. I don't see that in the entire code sent. See below for reference:
      Do you know why? "> model %>%

    • @jean-lucfanny4210
      @jean-lucfanny4210 Před 4 lety

      @@bkrai: I was just copying your code and run as you present it. Does it mean that I have to create the "model" somewhere else? I was going to your ode as it's so that I could apply it to my own dataset. I got the code from as it's. Thank you.

    • @jean-lucfanny4210
      @jean-lucfanny4210 Před 4 lety

      Dr. Bharatendra Rai: I think this is my issue" model model

  • @jean-lucfanny4210
    @jean-lucfanny4210 Před 4 lety +1

    Even when the library(keras) is there I get the same error. Thank you

    • @bkrai
      @bkrai  Před 4 lety

      share codes for model architecture so that I can have a look at it.

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

    Please make a video on Fuzzy logic using R.
    Thank you

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

    Many Thanks Dr Rai, i wanted your guidance to predict 14th Variable for fresh dummy data 'newdata' that i created to see if i can use this for a similar problem. Code attached below, pls help where am i going wrong. Used exactly your code which ran fine. Post which created newdata in same format/class. Below attached is additional code. Getting error: ValueError: No data provided for "dense_2_input". Need data for each key in: ['dense_2_input'] when trying to fit model. Appreciate your support.
    val

    • @bkrai
      @bkrai  Před 3 lety

      It says "no data provided". Make sure your data is available.

  • @henninghoffmann7598
    @henninghoffmann7598 Před 2 lety

    First of all, thank you! This video is awesome. Everythings works fine except the viewer. I installed the packages tfruns but I dont have a diagram of the fit. I get this message: /session/tfruns-metrics381c56414d7e/index.html?viewer_pane=1&capabilities=1&host=http%3A%2F%2F127.0.0.1%3A43071 not found
    Do anyone know what is wrong and how I can solve the problem? Thank you!

  • @fowobajek
    @fowobajek Před 4 lety

    The error message below is what i got when i try to run the model
    > model

    • @bkrai
      @bkrai  Před 4 lety

      Probably keras is not installed or running library line was missed.

  • @AnantaPradhan
    @AnantaPradhan Před 5 lety

    I am getting this message -Warning message: algorithm did not converge in 1 of 1 repetition(s) within the stepmax.

    • @bkrai
      @bkrai  Před 5 lety

      You can increase it to a higher number.

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

    Hi, I love your videos! Whilst trying to execute keras_model_sequential I get the following error: Error in initialize_python(required_module, use_environment): Installation of Python not found, Python bindings not loaded. I installed R but haven’t installed Python. Please can you advise if there are any easy fixes for this? Thanks 🙃

    • @bkrai
      @bkrai  Před 4 lety

      Make sure you install keras and tensorflow.

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

      Hi, thanks for your reply. I managed to get this working eventually. One thing I feel is missing from this video, is to show how you would get the probability of an outcome using some new data? For example, a file that contains the same data every week. This would make the video complete as it fully walks through the process for creating a model and testing from a sample of data and results using the training/testing partition method, together with how to test on new data, and how to export the results from the new data, into a flat file, for example. I feel your viewers would benefit from this additional content.

    • @bkrai
      @bkrai  Před 4 lety

      Thanks for the suggestion!