{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"private_outputs":true,"provenance":[],"authorship_tag":"ABX9TyOGXZs33URbCd8MFVDOeVHs"},"kernelspec":{"name":"ir","display_name":"R"},"language_info":{"name":"R"}},"cells":[{"cell_type":"code","execution_count":null,"metadata":{"id":"yu1qMJoWwbaO"},"outputs":[],"source":["install.packages(\"devtools\")\n","devtools::install_github(\"martinctc/rwa\")"]},{"cell_type":"code","source":["library(rwa)\n","library(tidyverse)"],"metadata":{"id":"Lm7-xh11w9fE"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["rsquare: the rsquare value of the regression model.\n","\n","result: the final output of the importance metrics.\n","\n","The Rescaled.RelWeight column sums up to 100.\n","\n","The Sign column indicates whether a predictor is positively or negatively correlated with the outcome.\n","\n","n: indicates the number of observations used in the analysis.\n","\n","lambda:\n","\n","RXX: Correlation matrix of all the predictor variables against each other.\n","\n","RXY: Correlation values of the predictor variables against the outcome variable"],"metadata":{"id":"tFWx4b6k0lT4"}},{"cell_type":"code","source":["mtcars %>%\n"," rwa(outcome = \"mpg\",\n"," predictors = c(\"cyl\", \"disp\", \"hp\", \"gear\"),\n"," applysigns = TRUE)"],"metadata":{"id":"DzjpS6TTxCq7"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["library(ggplot2)\n","rwa(diamonds,\"price\",c(\"depth\",\"carat\"))"],"metadata":{"id":"B__8tp9XyJoo"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["library(dplyr)\n","data_train <- read.csv(\"https://raw.githubusercontent.com/guru99-edu/R-Programming/master/train.csv\")\n","glimpse(data_train)\n","data_test <- read.csv(\"https://raw.githubusercontent.com/guru99-edu/R-Programming/master/test.csv\")\n","glimpse(data_test)"],"metadata":{"id":"lwQsSTZJYd_n"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["install.packages(\"randomForest\")\n","library(randomForest)"],"metadata":{"id":"mXqBprSbbCyG"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["RandomForest(formula, ntree=n, mtry=FALSE, maxnodes = NULL)"],"metadata":{"id":"_8Uc6OMHv5OA"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["library(caret)\n","library(e1071)"],"metadata":{"id":"5qSMgL78b0DB"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["trControl <- trainControl(method = \"cv\",\n"," number = 10,\n"," search = \"grid\")"],"metadata":{"id":"LH9fLIBxY2QQ"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":[],"metadata":{"id":"kZ25clb3b_2M"},"execution_count":null,"outputs":[]}]}