{"cells":[{"metadata":{"_uuid":"a7fce011a06ca1548f04d4d9ea04c48527b837ec"},"cell_type":"markdown","source":"# Exploratory variance\n**Some variance is not good for machine learning, thus we explore the variance which has bias between training and test data.**\n**Finaly, we found \"campaignCode\", \"adwordsClickInfo.isVideoAd\", and \"index\" is wrong variance for machine learning.**\n**Moreover, we consider that \"Google search: Top\" and \"Top\" are equal each other in the \"adwordsClickInfo.slot\".**"},{"metadata":{"_uuid":"c3c340ed2f1120f769ad951ceef349610fa4b69c"},"cell_type":"markdown","source":"**Loading library**"},{"metadata":{"_uuid":"929132f2e52e5726b4acb6cf4ad434cac3c25234","_execution_state":"idle","trusted":true},"cell_type":"code","source":"library(feather)\nlibrary(magrittr)\nlibrary(dplyr)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"d5b28fec9bb21338c281687997ceb8f594cf3950"},"cell_type":"markdown","source":"**Data loading from gstore-1-flatten which was processed by https://www.kaggle.com/burritodan/gstore-1-flatten, and adding the isNA column meaning transactionRevenue is zero or nor**"},{"metadata":{"trusted":true,"_uuid":"bcf6046816ed8ef403714b1d7632ab47deccdf3f"},"cell_type":"code","source":"df <- read_feather(\"../input/gstore-1-flatten/df.feather\") %>% select(-totalTransactionRevenue)\ndf <- cbind(df, isNA=1)\ndf$isNA[is.na(df$transactionRevenue)] <- 0","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"7fbdc35e8899975bd8008058f70ff13ce0c03c06"},"cell_type":"code","source":"colnames(df)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"ba057a9e6557d475958fb4633aa513c4305bf88a"},"cell_type":"markdown","source":"# Check the variance from \"isTruedirect\" to \"isNA\""},{"metadata":{"trusted":true,"_uuid":"85f2d3c5c166996fecd66a80387bdf2bec3ec55a"},"cell_type":"code","source":"df2 <- df %>% select(isTrueDirect, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"d4a72f2db35c616b9bdb9c4a3e81e95d1df0cd06"},"cell_type":"code","source":"df2 <- df %>% select(adContent, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"49880b2a5f303c7d814cc33a810b5128974c46d7"},"cell_type":"markdown","source":"# campaignCode is only one"},{"metadata":{"trusted":true,"_uuid":"4dfa4958bdd6870431a318fe898748d749f008f9"},"cell_type":"code","source":"df2 <- df %>% select(campaignCode, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"scrolled":true,"_uuid":"8b8c8bf71f7b09eb9dc2ba0c1e7f1f5ac077361a"},"cell_type":"code","source":"df2 <- df %>% select(adwordsClickInfo.page, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"d41c19445730f6397d421002d55a2f1eebc16c71"},"cell_type":"markdown","source":"# \"Google search: Top\" and \"Top\" is equal??"},{"metadata":{"trusted":true,"_uuid":"305e5a4b394f56408d93eaa21d0e8f709a7977eb"},"cell_type":"code","source":"df2 <- df %>% select(adwordsClickInfo.slot, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"dbb4558b4a7a32a3e7eb3ca4bbc0361a6105fa2c"},"cell_type":"code","source":"df2 <- df %>% select(adwordsClickInfo.adNetworkType, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"bd09b8edd64005718ccf48d7c5c73464d4e93a20"},"cell_type":"markdown","source":"# adwordsClickInfo.isVideoAd is only False"},{"metadata":{"trusted":true,"scrolled":true,"_uuid":"8e049ce54cd35a007207c110d292674e82fd1d41"},"cell_type":"code","source":"df2 <- df %>% select(adwordsClickInfo.isVideoAd, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"63c92aa7790600b7be449cfc5f69e46b04651152"},"cell_type":"markdown","source":"# index is only 4"},{"metadata":{"trusted":true,"_uuid":"b81f0481f316e5215786b93a94ddfce197a8ab6a"},"cell_type":"code","source":"df2 <- df %>% select(index, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1f7d9eaae2645c80109a038c4c29747ac3b6923a"},"cell_type":"code","source":"df2 <- df %>% select(value, test, isNA)\ntable(df2)","execution_count":null,"outputs":[]}],"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}