{"cells":[{"metadata":{"_uuid":"be59f926a10e55c7a57eb3605f1abe3cbe54e8a9"},"cell_type":"markdown","source":"---\n<center> <h1 style=\"color:#5856D6\">  ANSWER OF TIPICAL QUESTIONS WHEN WE WORK IN ANALYTICAL PROJECTS </h1> </center>\n\n---\n\n\n<h2 style=\"color:#007AFF;\"> 1. Introduction </h2>\n<p>In this kernel you going to learn about how to guide a data analysis based on CRISP-DM methodology. We provided question of each of phases and we applied to <b>elo competition</b>. We use R language to develop all analysis. </p>\n\n<p> You will learn in this kernel: </p>\n<ol>\n    <li> Phases of CRISP-DM methodology </li>\n    <li> Typical questions that you can do and solve in each phase of CRISP-DM methodology </li>\n    <li> How to do an exploratory analysis in R </li>\n    <li> How to built statistical and machine learning models in R </li>\n</ol>\n\n<h2 style=\"color:#007AFF;\"> 2. Contextualization </h2>\n<p>  All of us know that one of the most important parts of a project are the hipothesis that business expert have\naround some interest problem, topic or area.  In the same way, the questions are extremely important, because those give us different ways to do an analysis. We 'll see a list of typical questions that we define when start an data analysis.  </p>\n\n<p>Let me introduce CRISP-DM methodoloy, one of the most famous ways to develop analytical projects. We going to use this methodology to remark some of the possible questions that we can propose to start a data analysis.  </p>\n\n<p>The following are the ciclycal phases of CRISP-DM: </p>\n\n<ol>\n    <li> Business understanding </li> \n    <li> Data understanding  </li>\n    <li> Data preparation </li> \n    <li> Modeling </li> \n    <li> Evaluation </li> \n    <li> Deployment </li> \n</ol>\n\n<img src=\" D:\\Mis Documentos\\Pictures\\CRISP-DM_Image.jpg\" alt=\"CRISP-DM\">\n\nWe going trougth all this phases and we are going to do tipycal questions that we can find in a data analysis.\n\n<h2 style=\"color:#007AFF\"> 3. CRISP-DM phases and typical questions </h2>\n\n<h3 style=\"color:#5AC8FF\"> 3.1. Business understanding </h3>\nThis is a really important part of the analysis, if you don't understand business, goals,  market, economical context and other related aspects with the company, you have a very high probability to fail in your analysis. The following are some questions to know about the business context.\n\n* What is the history of the company?\n* What is their economical sector?\n* Is a service or products company?\n* What are the main goals in next year, two years and five years?\n* What is the business question that you need to solve? Try to divided in single parts.\n\nThose are the answers for these questions:\n\n<b> * What is the history of the company?  </b>\n\nElo is one of the major domestic debit and credit card in Brazil, is accepted in at least 185 countries and has over 80 million of cards. Only accept Real currency. This company is the result of partnership of three of the most largest banks in Brazil; Banco do Brasil, CAIXA and Bradesco. \n\n<b> * What is their economical sector?   </b>\n\nThe economical sector of elo is financial services.\n\n<b>* Is a service or products company?  </b>\n\nelo is a service company and data are a key and critical sucessful factor.\n\n<b>* What is the business question that you need to solve?   </b>\n\nWe need to develop algorithms to identify and serve most relevant opportunities for individuals, by uncovering signal in customer loyalty.\n\n<h3 style=\"color:#5AC8FF\"> 3.2 Data understanding </h3>\nIn this phases you must to know all about your data. The kind of data, variables, the temporality of the data and so on. Let me introduce some helpfull questions:\n\n<h4 style=\"color:#FF3B30\"> Category 1: About data set and features </h4>\n* What is the kind of data set?\n* Do we have a data frame, JSON, Excel file or other kind of format?\n* How many features do we have?\n* What kind of variables do we have?\n* How many registers do we have?\n\nSpecifically for elo competitions these are the answers.\n\n<b> * What is the kind of data set? </b>   \n\nIn <b> elo competition </b> we have seven .csv files. Whose names are:\n\n<ul>\n    <li> Train.csv </li>\n    <li> Test.csv</li>\n    <li> Historical_transactions.csv</li>\n    <li> new_merchant_transactions.csv </li>\n    <li> Merchant.csv </li>\n    <li> Data_Dictionary.csv</li>\n    <li> Sample_submission.csv</li>\n</ul>\n\n<b>* Do we have a data frame, JSON, Excel file or other kind of format? </b>   \n\nIn this competition all files are .csv format.  \n\n<b> * How many features do we have? </b>  \n\nFor answer this question we gonna list all features for .csv file.\n<p style=\"color:green\"> <b>* Train.csv/Test.csv: </b> </p>  We have six variables: card_id, first_active_month, feature_1, feature_2, feature_3, target.  \n<p style=\"color:green\"> <b>* Historical_transactions.csv/new_merchant_transactions.csv: </b> </p> We have fourteen variables: card_id, month_lag, purchase_date, authorized_flag, category_3, installments, category_1, merchant_category_id, subsector_id, merchant_id, purchase_amount, city_id, state_id, category_2.  \n<p style=\"color:green\"> <b> * merchant.csv: </b> </p>  We have twenty two variables; merchant_id, merchant_group_id, merchant_category_id, subsector_id, numerical_1, numerical_2, category_1, most_recent_sales_range, most_recent_purchases_range, avg_sales_lag3, avg_purchases_lag3, active_months_lag3, avg_sales_lag6, avg_purchases_lag6, active_months_lag6, avg_sales_lag12, avg_purchases_lag12, active_months_lag12, cateogy_4, city_id, state_id, category_2.\n\n\n\n\n\n"},{"metadata":{"_uuid":"a863af90620406a6d1ee1c172d7341133a5718a3"},"cell_type":"markdown","source":"<b> * What kind of variables do we have? </b>"},{"metadata":{"trusted":true,"_uuid":"113bc055fe361e283d163f8a3ce8a364c799ccf9"},"cell_type":"code","source":"# Before start with the variable analysis we need to load libraries\nlibrary(dplyr,suppressMessages);library(tidyr,suppressMessages);library(tidyverse,suppressMessages)\nlibrary(ggplot2,suppressMessages);library(caret,suppressMessages)\nsuppressMessages(library(readr))\nsuppressMessages(library(psych))\nsuppressMessages(library(e1071))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"417918024141978f502a9ec8a4f2a592e8ef7edf"},"cell_type":"code","source":"# We load files to analysis\nlist.files(path = \"../input\")","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"19a45fe69d56b63934c2fc69dc96ab372cef8352"},"cell_type":"markdown","source":"We are going to load and analyze .csv files "},{"metadata":{"trusted":true,"_uuid":"5baabf2738bff264c461adfb83c757c194d30082"},"cell_type":"code","source":"#Uploading .csv files\nhist_trxns <- read_csv(\"../input/historical_transactions.csv\")\nmerch <- read_csv(\"../input/merchants.csv\")\nnew_merch_trxns <- read_csv(\"../input/new_merchant_transactions.csv\")\ntest <- read_csv(\"../input/test.csv\")\ntrain <- read_csv(\"../input/train.csv\")","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"dc58291c4fdec5267e5a1189e6aa82f671349981"},"cell_type":"markdown","source":"As we can see we have seven files to develop the algorithms. Now we can see the kind of variables. \n\n<b> * How many registers do we have? </b>"},{"metadata":{"trusted":true,"_uuid":"c278ecfb9e357fb3f9165c6e935fe30ed9c3678c"},"cell_type":"code","source":"# Looking the dimension of each structure\ncat(\"Dimensions of hist_trxns file is: \",\"\\n\");dim(hist_trxns)\ncat(\"Dimensions of merch file is: \",\"\\n\");dim(merch)\ncat(\"Dimensions of new_merch_trxns file is: \",\"\\n\");dim(new_merch_trxns)\ncat(\"Dimensions of test file is: \",\"\\n\");dim(test)\ncat(\"Dimensions of train file is: \",\"\\n\");dim(train)\n","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"1f057afba0debef8f270e6752ef48c548f5ded11"},"cell_type":"markdown","source":"Aditionally we want to know how csv look like. Let me use head() and tail() function to learn more about files."},{"metadata":{"trusted":true,"_uuid":"989091e607a62bdf3ebff318d6296816c0ed261a"},"cell_type":"code","source":"# Head and tail for each file\ncat(\"First five registers of historical transactional dataset\");head(hist_trxns, n = 5)\ncat(\"First five registers of merchant dataset\");head(merch,n = 5)\ncat(\"First five registers of new merchant transactions dataset\");head(new_merch_trxns, n = 5)\ncat(\"First five registers of test dataset\");head(test, n = 5)\ncat(\"First five registers of train dataset\");head(train, n = 5)\n","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"8baebf4546b0703c50ba246e79cefadb25a4b48d"},"cell_type":"markdown","source":"<h4 style=\"color:#FF3B30\"> Category 2: Basic summary measures </h4>\n* What is the tipical statistical measures that we need to use to have a first sense of variables? \n* What are the tipical statistical measures for categorical features?\n* How we can analyze numerical feature vs categorical feature and viceversa?\n\n\n\n"},{"metadata":{"_uuid":"78a07d4ec28f24b404d522d0d7b6246f99ff4329"},"cell_type":"markdown","source":"We are going to solve each question:  \n\n<b> * What is the tipical statistical measures that we need to use to have a first sense of variables? </b>  \nThe tipical statistical measures are: minimun, maximum, mean, median and some position measures. The summary function in R let us look initial behaviour of features."},{"metadata":{"trusted":true,"_uuid":"b87944585a759c49a82f90c15dc7a0270fde7dd9"},"cell_type":"code","source":"# Summary of train and test dataset\nsummary(train)\nsummary(test)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"de92329468d98ad396dbb4266df71bf4a35fcb37"},"cell_type":"markdown","source":"</b>* What are the tipical statistical measures for categorical features? </b>   \nAditionally to last question we can use some other statistical measures like: standard deviation, kurtosis, bias coefficient, and so on. Based on previews works I want to introduce some functions to calculate different statistical measures.\n\n\n"},{"metadata":{"trusted":true,"_uuid":"af821ba48a89f66a71c8296ebb78ef3022bd089f"},"cell_type":"code","source":"# Function to find central statistical measures for one variable.\nMedTenCen <- function(Variable){\n      VarName <- deparse(substitute(Variable))\n      n <- length(Variable)\n      na <- sum(is.na(Variable))\n      Mean <- mean(Variable,na.rm=TRUE)\n      Median <- quantile(Variable,0.5,na.rm=TRUE)\n      P25 <- quantile(Variable,0.25,na.rm=TRUE)\n      P75 <- quantile(Variable,0.75,na.rm=TRUE)\n      Trimedia <- (P25 + 2*Median + P75)/4\n     # WinsorMean <- winsor.mean(Variable, trim = 0.2, na.rm = TRUE)\n      ArmonMean <- (1)/(mean(1/Variable))\n      GeomMean <- prod(Variable)^(1/n)\n      \n      cat(\"===============================================================================\\n\")\n      cat(\"The followind are the results of exploratory data analysis for\",VarName,\"\\n\")\n      cat(\"The total of rows are:\",n,\"\\n\")\n      cat(\"Below correspond to \",na/n*100,\"%\",\"of all rows\",\"\\n\")\n      cat(\"We found in the analysis\",na,\"NAs\",\"\\n\")\n      cat(\"\\n\")\n      \n      cat(\"***************************************************************************\",\"\\n\")\n      cat(\"The central statistical measures for \",VarName,\"are:\",\"\\n\")\n      cat(\"***************************************************************************\",\"\\n\")\n      cat(\"Mean:\",Mean,\"\\n\")\n      cat(\"Geometrical mean:\",GeomMean,\"\\n\")\n      cat(\"Armonic mean:\", ArmonMean, \"\\n\")\n      cat(\"Trimedia:\", Trimedia, \"\\n\")\n      #cat(\"WinsorMean\", WinsorMean, \"\\n\")\n      cat(\"***************************************************************************\",\"\\n\")\n}\n# Example: testing if function have sense\nVariable <- rnorm(1000,0,1)\nDummy_df <- data.frame(Var1=Variable)\nMedTenCen(Dummy_df$Var1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"703e7dbc536531626c71322bad0a83e0143ca94a"},"cell_type":"code","source":"# Function to find percentils of one variable.\nMedPos <- function(Variable){\n      VarName <- deparse(substitute(Variable))\n      Min <- min(Variable,na.rm=TRUE)\n      P1 <- quantile(Variable,0.01,na.rm=TRUE)\n      P5 <- quantile(Variable,0.05,na.rm=TRUE)\n      P10 <- quantile(Variable,0.1,na.rm=TRUE)\n      P25 <- quantile(Variable,0.25,na.rm=TRUE)\n      Median <- quantile(Variable,0.5,na.rm=TRUE)\n      P75 <- quantile(Variable,0.75,na.rm=TRUE)\n      P90 <- quantile(Variable,0.9,na.rm=TRUE)\n      P95 <- quantile(Variable,0.95,na.rm=TRUE)\n      P99 <- quantile(Variable,0.99,na.rm=TRUE)  \n      Max <- max(Variable)\n      \n      cat(\"***************************************************************************\",\"\\n\")\n      cat(\"The position measures for variable\",VarName,\"are:\",\"\\n\")\n      cat(\"***************************************************************************\",\"\\n\")\n      cat(\"Minimum:\", Min,\"\\n\")\n      cat(\"Percentil 1:\",P1 ,\"\\n\")\n      cat(\"Percentil 5:\",P5 ,\"\\n\")\n      cat(\"Percentil 10:\",P10 ,\"\\n\")\n      cat(\"Percentil 25:\",P25 ,\"\\n\")\n      cat(\"Percentil 50:\",Median ,\"\\n\")\n      cat(\"Percentil 75:\",P75 ,\"\\n\")\n      cat(\"Percentil 90:\",P90 ,\"\\n\")\n      cat(\"Percentil 95:\",P95 ,\"\\n\")\n      cat(\"Percentil 99:\",P99 ,\"\\n\")\n      cat(\"Maximum:\",Max,\"\\n\")\n      cat(\"***************************************************************************\",\"\\n\")\n}\n# Example: testing if function have sense\nVariable <- rnorm(1000,0,1)\nDummy_df <- data.frame(Var1=Variable)\nMedPos(Dummy_df$Var1)\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"d74ccb2bd2d23868fdaef171c1b835229d9f8ce3"},"cell_type":"code","source":"# This function find variable measures for one variable.\nMedDis <- function(Variable){\n      VarName <- deparse(substitute(Variable))\n      P25 <- quantile(Variable,0.25,na.rm=TRUE)\n      P75 <- quantile(Variable,0.75,na.rm=TRUE)\n      IQR <- P75 - P25\n      DesEst <- sd(Variable)\n      TempOutDeb <- Variable <= (P25[[1]] - 1.5*IQR[[1]])\n      OutDeb <- length(TempOutDeb[TempOutDeb==TRUE])\n      ValOutDeb <- ifelse(OutDeb==0, paste(\"Without outliers under\"),\n                          Variable[TempOutDeb==TRUE])\n      TempOutEnc <- Variable >= P75[[1]] + 1.5*IQR[[1]]\n      OutEnc <- length(TempOutEnc[TempOutEnc==TRUE])\n      ValOutEnc <- ifelse(OutEnc==0, paste(\"without outliers above\"),\n                          Variable[TempOutEnc==TRUE])\n      \n      cat(\"***************************************************************************\",\"\\n\")\n      cat(\"Dispersion metrics for variable\",VarName,\"are:\",\"\\n\")\n      cat(\"***************************************************************************\",\"\\n\")\n      cat(\"Variance:\", DesEst^2,\"\\n\")\n      cat(\"Standard deviation:\",DesEst,\"\\n\")\n      cat(\"Intercuartil range:\",IQR,\"\\n\")\n      cat(\"***************************************************************************\",\"\\n\")\n      cat(\"The outliers of variable\",VarName,\"are:\",\"\\n\")\n      cat(\"***************************************************************************\",\"\\n\")\n      cat(\"Value of outlier over of Q1-1.5IQR is:\",ValOutDeb,\"\\n\")\n      cat(\"Value of outlier above of Q3+1.5IQR is:\",ValOutEnc,\"\\n\")\n      cat(\"***************************************************************************\",\"\\n\")\n}\n# Example: testing if function have sense\nVariable <- rnorm(1000,0,1)\nDummy_df <- data.frame(Var1=Variable)\nMedDis(Dummy_df$Var1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"41296d3e7626e5af2783ad4ed51246599c4a484d"},"cell_type":"code","source":"# Function to identify the shape of the variable\nMedFor <- function(Variable){\n    VarName <- deparse(substitute(Variable))\n    Kurtosis <- kurtosis(Variable)\n    ExcCurt <- 3-Kurtosis  \n    Bias <- skewness(Variable) \n  \n   cat(\"***************************************************************************\",\"\\n\")\n   cat(\"The shape measures of \", VarName, \"are:\", \"\\n\")\n   cat(\"***************************************************************************\",\"\\n\")\n   cat(\"Curtosis:\", Kurtosis, \"\\n\")\n   cat(\"Exceso de curtosis:\", ExcCurt, \"\\n\")\n   cat(\"Bias:\", Bias, \"\\n\")\n   cat(\"***************************************************************************\",\"\\n\")\n}\n# Example: testing if function have sense\nVariable <- rnorm(1000,0,1)\nMedFor(Variable)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"413eb0b9823bad81e247b8516d151abe848ff4a8"},"cell_type":"markdown","source":"Now we are going to apply this functions to features of train and test set"},{"metadata":{"trusted":true,"_uuid":"95d62b5c9f22b601d177df3836156ac4094eb6d4"},"cell_type":"code","source":"#Applying function MedTenCen to train set\ncat(\"Results for feature 1 in train set\",\"\\n\");MedTenCen(train$feature_1)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 2 in train set\",\"\\n\");MedTenCen(train$feature_2)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 3 in train set\",\"\\n\");MedTenCen(train$feature_3)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for target in train set\",\"\\n\");MedTenCen(train$target)\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"5515464572c00c913f5dcdf4e3511552246e5ed5"},"cell_type":"code","source":"#Applying function MedTenCen to test set\ncat(\"Results for feature 1 in test set\",\"\\n\");MedTenCen(test$feature_1)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 2 in test set\",\"\\n\");MedTenCen(test$feature_2)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 3 in test set\",\"\\n\");MedTenCen(test$feature_3)\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"a0b15b123d4532585b1974eb1a20036ca3504d18"},"cell_type":"code","source":"#Applying function MedPos to train set\ncat(\"Results for feature 1 in train set\",\"\\n\");MedPos(train$feature_1)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 2 in train set\",\"\\n\");MedPos(train$feature_2)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 3 in train set\",\"\\n\");MedPos(train$feature_3)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for target in train set\",\"\\n\");MedPos(train$target)\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"67d9e59a4527dca7d40756408e03e05a06e41210"},"cell_type":"code","source":"#Applying function MedPos to test set\ncat(\"Results for feature 1 in test set\",\"\\n\");MedPos(test$feature_1)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 2 in test set\",\"\\n\");MedPos(test$feature_2)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 3 in test set\",\"\\n\");MedPos(test$feature_3)\n\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"bf8006e1945de25b9df86d341babfd80f8065848"},"cell_type":"code","source":"#Applying function MedDis to train set\ncat(\"Results for feature 1 in train set\",\"\\n\");MedDis(train$feature_1)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 2 in train set\",\"\\n\");MedDis(train$feature_2)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 3 in train set\",\"\\n\");MedDis(train$feature_3)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for target in train set\",\"\\n\");MedDis(train$target)\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1062d21669e0a8e0685b42652fc4dedb6d05d42a"},"cell_type":"code","source":"#Applying function MedDis to test set\ncat(\"Results for feature 1 in test set\",\"\\n\");MedDis(test$feature_1)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 2 in test set\",\"\\n\");MedDis(test$feature_2)\ncat(\"---------------------\",\"\\n\")\ncat(\"---------------------\",\"\\n\")\ncat(\"Results for feature 3 in test set\",\"\\n\");MedDis(test$feature_3)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"4d6ca4abd877cf93f525c3f14aa8822e3e8f11d9"},"cell_type":"markdown","source":"<h4 style=\"color:#FF3B30\"> Category 3: Graphics </h4>\n* What kind of plot we can use to plot a single numerical variable?\n* What kinf of plot we can use to plot two numerical variables?\n* What kind of plot we can use to plot categorical vs numerical variable?  \n\nWe 'll to show some of the ways that you can plot numerical variables."},{"metadata":{"trusted":true,"_uuid":"c3cf6147c0322956ca06cf01c7c6e0062676478f"},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"5dd87d24e2110aa342c5a873bf45c1d922a3db7f","trusted":true},"cell_type":"code","source":"# Plot of target variable in train and test set\na <- ggplot(train,aes(target))\na + geom_histogram() + ggtitle(\"Histogram of target feature\")\n","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"4e97829e10e7d3f0b0400b88908150ee981536d4"},"cell_type":"markdown","source":"Let's remember summary measures of target variable."},{"metadata":{"trusted":true,"_uuid":"c2c170209e22a5621e95d5e785ed6f8838935059"},"cell_type":"code","source":"# Target feature summary results\nsummary(train$target)\nsd(train$target)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"516c1a8cbbd066c2f0e4609003b9f5fe751d0146"},"cell_type":"markdown","source":"\nIs possible that target variable be a normal distribution."},{"metadata":{"trusted":true,"_uuid":"4ef2259034c5a94caff9ffe2f619290e15a3bd93"},"cell_type":"code","source":"#Normal test, Jarque Bera\nlibrary(tseries)\njarque.bera.test(train$target)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"0723f6468efd89140f258042a3a20ce9c9c87826"},"cell_type":"markdown","source":"Based on results target variable don't follow a normal distribution."},{"metadata":{"_uuid":"19b5862ec7fc68e7128e0ae4cf2f463e16611e43"},"cell_type":"markdown","source":""},{"metadata":{"_uuid":"c10434dafd8d990efe4157473e1f350c77365ee1"},"cell_type":"markdown","source":"<h3 style=\"color:#5AC8FF\"> 3.3. Data preparation</h3>\nThis important part of analysis is related to identify missing values, missing features, join different set of data. In other hand we can explore some ways to impute data. Let's explore data and join to me to define the health status of data sets.  \nSome tipical questions are:\n<ul>\n    <li> How many variables have missing data? </li>\n    <li> Which of those variables with missing are mandatory to be part of the model?</li>\n    <li> What proportion of all register do you have with missing values? </li>\n    <li> Based on your expertise is possible to impute some variables?</li>\n    <li>What are the new variables that you considered need to create? </li>\n    <li> Do you consider do some kind of transformation, scaling or standarization?</li>\n    <li> Do you consider that you need to create new datasets based on the actuals?</li>\n    \n </ul>"},{"metadata":{"_uuid":"1efd1bf5b6fbce7a1ca2f4ade522ab75b8c62cf7"},"cell_type":"markdown","source":"<h3 style=\"color:#5AC8FF\"> 3.4. Modeling</h3>\n"},{"metadata":{"_uuid":"3c9d50834a437e11022c7e1b5c25a1af4cd39ce6"},"cell_type":"markdown","source":"<h3 style=\"color:#5AC8FF\"> 3.5. Evaluation</h3>"},{"metadata":{"_uuid":"0ef9e57a4c3d500f6073cc7d4bcebb7d50bdc7bf"},"cell_type":"markdown","source":""}],"metadata":{"kernelspec":{"display_name":"R","language":"R","name":"ir"},"language_info":{"mimetype":"text/x-r-source","name":"R","pygments_lexer":"r","version":"3.4.2","file_extension":".r","codemirror_mode":"r"}},"nbformat":4,"nbformat_minor":1}