{"id":2255,"date":"2018-03-01T15:45:03","date_gmt":"2018-03-01T10:15:03","guid":{"rendered":"http:\/\/stepbystepschools.net\/?p=2255"},"modified":"2018-03-01T15:45:03","modified_gmt":"2018-03-01T10:15:03","slug":"data-science-training-in-mumbai-using-logistic-regression-with-r-programming-using-visual-studio","status":"publish","type":"post","link":"https:\/\/www.stepbystepschools.net\/?p=2255","title":{"rendered":"Data Science Training in Mumbai : &#8211; Using Logistic Regression with R Programming using Visual Studio."},"content":{"rendered":"<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png\" rel=\"attachment wp-att-2281\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png\" alt=\"1\" width=\"602\" height=\"303\" class=\"aligncenter size-full wp-image-2281\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2-300x151.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<p>The Logistic Regression is special type regression model in which the response variable also known as dependent variable has categorical values such as 0\/1 or True\/False.<\/p>\n<p>Logistic Regression in reality measures the probability of a binary response as the value of response variable based on the mathematical equation relating it with the predictor variables.<\/p>\n<p>Cases where the dependent variable has more than two outcome categories may be analysed in multinomial logistic regression, or, if the multiple categories are ordered, in ordinal logistic regression.<\/p>\n<p>The binary response can be estimated using binary logistic model on one or more predictor or independent variables aka features.<\/p>\n<p>It lets one to say that the presence of this risk factor will increase the odds of a given outcome by a specific factor and the model is not a classifier but a direct probability model.<\/p>\n<p>The equation for Logistic Regression is as can be used follows:<\/p>\n<p><b>y = 1\/(1+e^-(a+b1x1+b2x2+b3x3+&#8230;))<\/b><\/p>\n<p>Following is the description of the parameters used &#8722;<\/p>\n<ul>\n<li><b>y :<\/b>It is a response variable.<\/li>\n<li><b>x :<\/b>It is a predictor variable.<\/li>\n<li><b>a , b :<\/b>They are the coefficients which represent numeric constants.<\/li>\n<\/ul>\n<p>The glm() function is used to create regression model.<\/p>\n<p>Syntax<\/p>\n<p>The <b>glm()<\/b> function is used for a general equation for logistic regression is &#8722;<\/p>\n<p><b>glm(formula,data,family)<\/b><\/p>\n<p>Where<\/p>\n<ul>\n<li><b>formula :<\/b>It is the symbol presenting the relationship between the variables.<\/li>\n<li><b>data :<\/b>It is the dataset which gives the values of these variables.<\/li>\n<li><b>family :<\/b>It is R object to specify the details of the model and it has a value which is binomial for logistic regression.<\/li>\n<\/ul>\n<p>To create and run our R program in Visual Studio we must first install some tools.<\/p>\n<p>Now open Visual Studio on your pc and then click on Get Tools and features&#8230; inside Tools.<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/2-2.png\" rel=\"attachment wp-att-2282\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/2-2.png\" alt=\"2\" width=\"602\" height=\"61\" class=\"alignleft size-full wp-image-2282\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/2-2.png 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/2-2-300x30.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><br \/>\n<\/br><\/p>\n<p>Now in the feature installation window check and install the following features.<\/p>\n<p>For Visual Studio 2017<\/p>\n<p>Contains Tools for Data Science<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/3-2.png\" rel=\"attachment wp-att-2283\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/3-2.png\" alt=\"3\" width=\"403\" height=\"86\" class=\"alignleft size-full wp-image-2283\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/3-2.png 403w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/3-2-300x64.png 300w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/a><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p>After this please install R tools from the following link if the above package is not installed properly from the following link<\/p>\n<p>But it is not necessary<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/rtvs\/installing-r-tools-for-visual-studio\">https:\/\/docs.microsoft.com\/en-us\/visualstudio\/rtvs\/installing-r-tools-for-visual-studio<\/a><\/p>\n<p>You can also install R programming tool go to the following link for better support and download the software and install it<\/p>\n<p><b>For Windows Users:<\/b><\/p>\n<p><a target=\"_blank\" href=\"https:\/\/ftp.iitm.ac.in\/cran\/\">https:\/\/ftp.iitm.ac.in\/cran\/<\/a><\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/4-2.png\" rel=\"attachment wp-att-2284\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/4-2.png\" alt=\"4\" width=\"602\" height=\"118\" class=\"alignleft size-full wp-image-2284\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/4-2.png 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/4-2-300x59.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p><b>For Linux Users:<\/b><\/p>\n<p>If you are on Linux platform then you can use this fast and easy command used in Linux which can be used to install R. The yum command is used for installing like this:<\/p>\n<p><span style=\"background-color: #C0C0C0\">$ yum install R<\/span><\/p>\n<p>For Ubuntu Linux or other Debian-related OSs, a more direct method is:<\/p>\n<p><span style=\"background-color: #C0C0C0\">$ apt-get install r-base<\/span><\/p>\n<p>Now let us start creating our R application in visual studio<\/p>\n<p>Go to Files ->Project and add a new R project<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/5-2.png\" rel=\"attachment wp-att-2285\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/5-2.png\" alt=\"5\" width=\"602\" height=\"368\" class=\"aligncenter size-full wp-image-2285\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/5-2.png 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/5-2-300x183.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<p>This is our project structure:<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/6-2.png\" rel=\"attachment wp-att-2286\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/6-2.png\" alt=\"6\" width=\"319\" height=\"181\" class=\"alignleft size-full wp-image-2286\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/6-2.png 319w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/6-2-300x170.png 300w\" sizes=\"(max-width: 319px) 100vw, 319px\" \/><\/a><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p>Now on the top left side is a new R file (script.R) where we can edit source code with all of Visual Studio Ide editing features.<\/p>\n<p>Also on the bottom left of Visual Studio is where you can find an R Interactive window in which you can interactively develop and test code.<\/p>\n<p>We can directly use R Interactive without the need of opening any new project.<\/p>\n<p>Now let us see a demonstration of Logistic regression:<\/p>\n<p>The pre-existing dataset &#8220;mtcars&#8221; describes different models of a car with their various engine specifications.<\/p>\n<p>In &#8220;mtcars&#8221; data set transmission mode (automatic or manual) is described by the column am which a binary value (0 or 1) is.<\/p>\n<p>Here we can create a logistic regression model between the different columns namely &#8220;am&#8221; and 3 other columns &#8211; hp, cyl and wt.<\/p>\n<p><span style=\"background-color: #C0C0C0\">input <- mtcars[,c(\"am\",\"cyl\",\"hp\",\"wt\")]<\/span><\/p>\n<p># applying Logistic regression to the data<br \/>\n<span style=\"background-color: #C0C0C0\">am.data = glm(formula = am ~ cyl + hp + wt, data = input, family = binomial)<br \/>\n<\/span><span style=\"background-color: #C0C0C0\">print(am.data)<br \/>\n<\/span><span style=\"background-color: #C0C0C0\">print(summary(am.data))<br \/>\n<\/span>\n<\/p>\n<p><b>Output:<\/b><\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/7-2.png\" rel=\"attachment wp-att-2287\"><img loading=\"lazy\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/7-2.png\" alt=\"7\" width=\"602\" height=\"585\" class=\"alignleft size-full wp-image-2287\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/7-2.png 602w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2018\/03\/7-2-300x292.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p><a target=\"_blank\" href=\"http:\/\/stepbystepschools.net\/?page_id=1842\">Syllabus of Data Science training in Mumbai<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Logistic Regression is special type regression model in which the response variable also known as dependent variable has categorical values such as 0\/1 or True\/False. Logistic Regression in reality measures the probability of a binary response as the value &hellip; <a href=\"https:\/\/www.stepbystepschools.net\/?p=2255\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1],"tags":[198,199,227,214,202,213],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Data Science Training in Mumbai : - Using Logistic Regression with R Programming using Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.stepbystepschools.net\/?p=2255\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Science Training in Mumbai : - Using Logistic Regression with R Programming using Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"og:description\" content=\"The Logistic Regression is special type regression model in which the response variable also known as dependent variable has categorical values such as 0\/1 or True\/False. Logistic Regression in reality measures the probability of a binary response as the value &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stepbystepschools.net\/?p=2255\" \/>\n<meta property=\"og:site_name\" content=\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-01T10:15:03+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"StepByStepSchoolsSupport\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\",\"url\":\"https:\/\/www.stepbystepschools.net\/\",\"name\":\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"description\":\"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stepbystepschools.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2255#primaryimage\",\"url\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png\",\"contentUrl\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2255#webpage\",\"url\":\"https:\/\/www.stepbystepschools.net\/?p=2255\",\"name\":\"Data Science Training in Mumbai : - Using Logistic Regression with R Programming using Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"isPartOf\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2255#primaryimage\"},\"datePublished\":\"2018-03-01T10:15:03+00:00\",\"dateModified\":\"2018-03-01T10:15:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2255#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stepbystepschools.net\/?p=2255\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=2255#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stepbystepschools.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Science Training in Mumbai : &#8211; Using Logistic Regression with R Programming using Visual Studio.\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655\",\"name\":\"StepByStepSchoolsSupport\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g\",\"caption\":\"StepByStepSchoolsSupport\"},\"url\":\"https:\/\/www.stepbystepschools.net\/?author=40\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Science Training in Mumbai : - Using Logistic Regression with R Programming using Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.stepbystepschools.net\/?p=2255","og_locale":"en_US","og_type":"article","og_title":"Data Science Training in Mumbai : - Using Logistic Regression with R Programming using Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","og_description":"The Logistic Regression is special type regression model in which the response variable also known as dependent variable has categorical values such as 0\/1 or True\/False. Logistic Regression in reality measures the probability of a binary response as the value &hellip; Continue reading &rarr;","og_url":"https:\/\/www.stepbystepschools.net\/?p=2255","og_site_name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","article_published_time":"2018-03-01T10:15:03+00:00","og_image":[{"url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"StepByStepSchoolsSupport","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.stepbystepschools.net\/#website","url":"https:\/\/www.stepbystepschools.net\/","name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","description":"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stepbystepschools.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/?p=2255#primaryimage","url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png","contentUrl":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2018\/03\/1-2.png"},{"@type":"WebPage","@id":"https:\/\/www.stepbystepschools.net\/?p=2255#webpage","url":"https:\/\/www.stepbystepschools.net\/?p=2255","name":"Data Science Training in Mumbai : - Using Logistic Regression with R Programming using Visual Studio. - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","isPartOf":{"@id":"https:\/\/www.stepbystepschools.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stepbystepschools.net\/?p=2255#primaryimage"},"datePublished":"2018-03-01T10:15:03+00:00","dateModified":"2018-03-01T10:15:03+00:00","author":{"@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655"},"breadcrumb":{"@id":"https:\/\/www.stepbystepschools.net\/?p=2255#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stepbystepschools.net\/?p=2255"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.stepbystepschools.net\/?p=2255#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stepbystepschools.net\/"},{"@type":"ListItem","position":2,"name":"Data Science Training in Mumbai : &#8211; Using Logistic Regression with R Programming using Visual Studio."}]},{"@type":"Person","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655","name":"StepByStepSchoolsSupport","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g","caption":"StepByStepSchoolsSupport"},"url":"https:\/\/www.stepbystepschools.net\/?author=40"}]}},"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2255"}],"collection":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2255"}],"version-history":[{"count":5,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2255\/revisions"}],"predecessor-version":[{"id":2292,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/2255\/revisions\/2292"}],"wp:attachment":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}