DS - R | May 14 - May 30 | Nimisha

Discussion in 'Big Data and Analytics' started by K Manoj, May 14, 2018.

  1. K Manoj

    K Manoj Moderator
    Staff Member Simplilearn Support

    Joined:
    Aug 4, 2017
    Messages:
    231
    Likes Received:
    21
    *thread locked for this batch.
    Please post your questions below.
     
    #1
  2. vikas gupta

    vikas gupta Member
    Alumni

    Joined:
    Mar 19, 2016
    Messages:
    6
    Likes Received:
    4
    Hi All, Glad to be part of this batch. Happy learning.
     
    #2
    Mahesh KR likes this.
  3. Jonathan Stroup

    Jonathan Stroup Customer
    Customer

    Joined:
    May 10, 2018
    Messages:
    1
    Likes Received:
    0
    I can no longer see the course resources. Am I possibly looking in the wrong place?
     
    #3
  4. Arpita Khanwalkar

    Alumni

    Joined:
    Mar 31, 2018
    Messages:
    5
    Likes Received:
    2
    Hi Manoj.. Is it possible to share class schedule in terms of which topics will be covered in which class? Is this schedule already available?

    With prior information of which topics will be covered in each class, it will be easier for us to plan completion of e-modules/reading of content before we attend the class.
     
    #4
    Mahesh KR likes this.
  5. Mahesh KR

    Mahesh KR Member
    Alumni

    Joined:
    Apr 27, 2018
    Messages:
    14
    Likes Received:
    2

    Yes I am on the same page, a brief outlook of what topics may be covered in each class will definitely help us to do our part before attending the class. To be very frank last day class (May 15th) was bouncer for me as I do not have exposure to programming languages.
     
    #5
  6. _29634

    _29634 Member

    Joined:
    Apr 18, 2018
    Messages:
    2
    Likes Received:
    0
    I did not see any feedback survey yesterday and today. Though it is mentioned at the end of the session to give feedback I don't see the survey link being shared to update the feedback.
     
    #6
  7. _29634

    _29634 Member

    Joined:
    Apr 18, 2018
    Messages:
    2
    Likes Received:
    0
    Hi Manoj, I did not see any feedback survey yesterday and today. Though it is mentioned at the end of the session to give feedback I don't see the survey link being shared to update the feedback.
     
    #7
  8. _30204

    _30204 Member

    Joined:
    Apr 24, 2018
    Messages:
    7
    Likes Received:
    0
    total_M<-readline(prompt = "EnterMarks:")

    class(total_M)

    total_M<-as.numeric(total_M)

    x<-total_M

    if(x>=80){
    print(paste("GradeA",x))

    }else if(x>=60 && x<=79){
    print(paste("GradeB",x))

    }else {print("Fail")}


    Error in if (x >= 80) { : missing value where TRUE/FALSE needed
    Why this is not executing

    If i assign value to the variable directly eg x<-70 it working fine
     
    #8
  9. _28952

    _28952 Member

    Joined:
    Apr 11, 2018
    Messages:
    11
    Likes Received:
    0
    I am not sure why you are getting that error. I tried to give a value of 90 and I got no errors. When you entered the value when prompted, are you sure you gave a numeric value and hope no extra character creeped in.
     
    #9
  10. Mahesh KR

    Mahesh KR Member
    Alumni

    Joined:
    Apr 27, 2018
    Messages:
    14
    Likes Received:
    2
    Hello Nimisha,

    Please upload the May 18th class video. I see only 4 videos of first 4 classes, except last day class.

    thank you
     
    #10
  11. Arpita Khanwalkar

    Alumni

    Joined:
    Mar 31, 2018
    Messages:
    5
    Likes Received:
    2
    Hi.. I am getting error on execution of below code. Can someone help what is going wrong?

    Error in print(delhi) : object 'delhi' not found

    Code as below :

    city<-"Delhi"
    if (city == "Delhi"){
    print(delhi)
    }else if (city == "Moscow"){
    print(moscow)
    }else if (city == "London"){
    print(london)
    }else if (city == "madrid"){
    print(madrid)
    }else {
    print("city not in db")
    }
     
    #11
  12. _30204

    _30204 Member

    Joined:
    Apr 24, 2018
    Messages:
    7
    Likes Received:
    0
    Hi Nimisha,
    I wont be able to join the classes from today due to my deliverables.

    Thanks,
    Vamshi
     
    #12
  13. Mahesh KR

    Mahesh KR Member
    Alumni

    Joined:
    Apr 27, 2018
    Messages:
    14
    Likes Received:
    2
    Can anyone please explain me the difference between:
    1. for loop and while loop with examples?
    2. why do we have for loop and while loop both?
    3. any specific case where only for loop alone/while loop alone is suitable ?

    This was told in the class if am correct,
    In For Loop , " u know how many times exactly u have to repeat statements".
    In while Loop, " till the time a given condition is true it will keep on iterating itself", "u need to specify a condition and the loop will operate till the time condition is true.

    My confusion is that, almost both the statements sounds same,

    Please clarify me with examples.
     
    #13
  14. Mahesh KR

    Mahesh KR Member
    Alumni

    Joined:
    Apr 27, 2018
    Messages:
    14
    Likes Received:
    2

    FInd the below code:

    if (city == "Delhi"){
    + print("Delhi")
    +
    + }else if (city == "Moscow"){
    + print(moscow)
    +
    + }else if (city == "London"){
    + print(london)
    +
    + }else if (city == "madrid"){
    + print(madrid)
    +
    + }else {
    + print("city not in db")
    + }
    [1] "Delhi"
     
    #14
    Arpita Khanwalkar likes this.
  15. Mahesh KR

    Mahesh KR Member
    Alumni

    Joined:
    Apr 27, 2018
    Messages:
    14
    Likes Received:
    2

    In print option put Delhi in "", and run u will get it, i.e

    print ("Delhi")
     
    #15
  16. Arpita Khanwalkar

    Alumni

    Joined:
    Mar 31, 2018
    Messages:
    5
    Likes Received:
    2
    Thanks Mahesh.. got it! It works now.
     
    #16
  17. _28952

    _28952 Member

    Joined:
    Apr 11, 2018
    Messages:
    11
    Likes Received:
    0
    How come when I login my name is shown as a number? And under profile there is no place to add my name.
     
    #17
  18. _28952

    _28952 Member

    Joined:
    Apr 11, 2018
    Messages:
    11
    Likes Received:
    0
    hp <- read.csv(file.choose(),header=T)
    View(hp)

    attach(hp)
    ## correlation between any two variables

    plot(Price,LivingArea)

    When I try to plot, I get the following error

    > plot(Price,LivingArea)
    Error in plot.new() : figure margins too large
    >

    PS: I am using "Lesson 10 Regression Analysis Ex 1.csv" as my dataset
     
    #18
  19. _28952

    _28952 Member

    Joined:
    Apr 11, 2018
    Messages:
    11
    Likes Received:
    0
    Is there a way to find out in which package does a function exists? For example I have a function called "abc", if I do a ?abc, it will give me how to use that function, but not any details on which package it exists.

    Any idea???
     
    #19
  20. Priyanka_Mehta

    Priyanka_Mehta Well-Known Member
    Simplilearn Support

    Joined:
    May 25, 2017
    Messages:
    828
    Likes Received:
    57
    HI,
    Kindly try invoking dev.off() to make RStudio open up a new graphics device with default settings. Or click the 'broomstick' figure "Clear All Plots" in Plots tab and try plot() again. Moreover Execute the command
    graphics.off()

    I am sure this will help you.
     
    #20
  21. Priyanka_Mehta

    Priyanka_Mehta Well-Known Member
    Simplilearn Support

    Joined:
    May 25, 2017
    Messages:
    828
    Likes Received:
    57
    Hi,
    I would like to inform you that, when you use ?function, it gives us details about the function and also on top left corner you will see the package name. Kindly find the screenshot mentioned below:
    upload_2018-5-23_21-45-34.png

    I hope this will help you.
     
    #21
  22. Manjesh Kumar S

    Joined:
    May 8, 2018
    Messages:
    7
    Likes Received:
    2
    in place of print(delhi) use print("delhi"). Same goes with moscow london and madird... note that any text string should be with single and double quotes, otherwise R thinks it as variable...
     
    #22
  23. Manjesh Kumar S

    Joined:
    May 8, 2018
    Messages:
    7
    Likes Received:
    2
    Hi Nimisha,

    I have done some analysis on the multi-linear regression as discussed in the class room training of 23rd May 2018. Attached is the HTML file which has all my analysis along with the inferences.
    I've used 'Lesson 10 Regression Analysis Ex 2.csv' data for my analysis to predict PE using multi-linear regression. All steps explained and my understandings also noted.
    I could able to achieve correlation accuracy between actual vs predicted up to 96.12%

    Note: it's R Markdown converted to HTML file. Unzip the attachment and open HTML document.
     

    Attached Files:

    #23
    Arpita Khanwalkar likes this.
  24. Manjesh Kumar S

    Joined:
    May 8, 2018
    Messages:
    7
    Likes Received:
    2
    Hi Mahesh,

    There is difference between them, hope you are from programming background.

    'For' loop will know exactly how many time iterations need to be performed, i.e. exact number (of course it works with indexes, and also you can have number of iteration in a variable). However 'While' loop will work on conditional statements i.e. any logical output expressions which results in true/false, for this to be so the expression you use must be changing inside loop at run time otherwise it may go to endless loop.

    Having said this, you can also tweak in such a way that in place of FOR loop you can use WHILE loop and vice-versa. It's just like you can use cutting-plier and nose-plier interchangeably for a particular job, but what is more suited is based on the job and suitability.

    Hope it clarifies.

    - Manjesh.
     
    #24
    Mahesh KR likes this.
  25. Nimisha_11

    Nimisha_11 Member
    Trainer

    Joined:
    Feb 26, 2018
    Messages:
    6
    Likes Received:
    4



    Hi
    increase the size of the plot/package window and this would work
     
    #25
  26. Mahesh KR

    Mahesh KR Member
    Alumni

    Joined:
    Apr 27, 2018
    Messages:
    14
    Likes Received:
    2
    thank you Manjesh.
     
    #26
  27. _28952

    _28952 Member

    Joined:
    Apr 11, 2018
    Messages:
    11
    Likes Received:
    0
    Thank you Priyanka. To add to this question, we will get help using the "?" only when the package is installed right?
    How to know what function is there in a package before you even install it. Like is there an online community or such where i should go and check before I install or is there a way to know from R Studio itself?
     
    #27
  28. Manjesh Kumar S

    Joined:
    May 8, 2018
    Messages:
    7
    Likes Received:
    2
    Hi,

    You can check the 'Packages' tab in the RStudio, It will list all the packages available (This is across R version you installed from CRAN, not applicable to custom packages built by researchers/R developers like from GITHUB etc). Once you click on one of the package it will list all the functions in alphabetical order, click on any function to check what it does and its arguments etc.

    If you get error as 'Could not find function <>' during execution, it may be due to package related to such function is not installed or library is not imported in R session using library() function. In such cases you can use '??' and then type your function name in console, to find out which package it belongs to and also what it does so that you can install that package and import and use them. Happy learning.

    Hope it helps.

    - Manjesh.
     
    #28
  29. Manjesh Kumar S

    Joined:
    May 8, 2018
    Messages:
    7
    Likes Received:
    2
    You can check 'https://cran.r-project.org/web/packages/available_packages_by_name.html', for all the available packages in CRAN.
     
    #29
  30. _28952

    _28952 Member

    Joined:
    Apr 11, 2018
    Messages:
    11
    Likes Received:
    0
    A hypothetical question ...say in our titanic example I found out there is a null value in "Survived" column

    table(is.na(data$Survived))

    Now how will I get to show just that row. I need to get the index number or row number. How do I get that?
     
    #30
  31. _28952

    _28952 Member

    Joined:
    Apr 11, 2018
    Messages:
    11
    Likes Received:
    0
    This is my code
    But the last line when I execute I get this error:
    Error in model.frame.default(formula = data_all$Purchased ~ ., data = train, :
    variable lengths differ (found for 'User.ID')
    >

    This is from yesterdays homework given by Rishi. The dataset used is Social_Network_ads.csv[/quote]
     
    #31
  32. Arpita Khanwalkar

    Alumni

    Joined:
    Mar 31, 2018
    Messages:
    5
    Likes Received:
    2
    Hi Manoj,

    I have received an e-mail from Simplilearn that I passed the project submission :).

    I have below questions in reference of this-
    1. The e-mail only says 'passed'. Do we also get some kind of rating/score for our performance in project submission?
    2. Do we get any feedback from SL team regarding our performance - like which code/inference was good or what could have been better etc..?
    3. Can we get detailed solution for the projects? I checked sample solution for healthcare project in (Projects for Submission folder) downloaded from Simplilearn, but, could find solution for Question-1 only (Total questions =6 for this project).
     
    #32
    Mahesh KR likes this.
  33. Mahesh KR

    Mahesh KR Member
    Alumni

    Joined:
    Apr 27, 2018
    Messages:
    14
    Likes Received:
    2
    Hey team mates, it was nice session overall, your active participation was a great thing, which boosted my learning ability too. Please be active in the group and lets be in touch, I have a long way to go, I am doing Integrated course in Big data and Data Science.

    thank you so much for all the participants and the entire simplilearn team for their valuable support specially our mentor Nimisha and Rishi.
     
    #33
    Arpita Khanwalkar likes this.

Share This Page