forked from mitujadhav/Data-Science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMicrosoft_R_Server_demo.R
63 lines (49 loc) · 2.03 KB
/
Microsoft_R_Server_demo.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
############## Load Data##################
Ch3Start <- Sys.time()
readPath <- rxGetOption("sampleDataDir")
infile <- file.path(readPath, "promoted_content1.txt")
hyphensTxt <- RxTextData(infile, delimiter="\t")
promoted_content <- rxImport(hyphensTxt)
colnames(promoted_content)[1]<-"ad_id"
colnames(promoted_content)[2]<-"document_id"
colnames(promoted_content)[3]<-"campaign_id"
colnames(promoted_content)[4]<-"advertiser_id"
names(promoted_content)
------------------------------------------------------
Ch3Start <- Sys.time()
readPath <- rxGetOption("sampleDataDir")
infile <- file.path(readPath, "page_views.txt")
hyphensTxt <- RxTextData(infile, delimiter="\t")
page_views <- rxImport(hyphensTxt)
page_views
colnames(page_views)[1]<-"uuid_id"
colnames(page_views)[2]<-"document_id"
colnames(page_views)[3]<-"timestamp_id"
colnames(page_views)[4]<-"platform_id"
colnames(page_views)[5]<-"geo_location"
colnames(page_views)[6]<-"traffic_source"
-------------------------------------------------------
Ch3Start <- Sys.time()
readPath <- rxGetOption("sampleDataDir")
infile <- file.path(readPath, "clicks_train.txt")
hyphensTxt <- RxTextData(infile, delimiter="\t")
clicks_train <- rxImport(hyphensTxt)
colnames(clicks_train)[1]<-"display_id"
colnames(clicks_train)[2]<-"ad_id"
colnames(clicks_train)[3]<-"clicked"
names(clicks_train)
-------------------------------------------------------
Ch3Start <- Sys.time()
readPath <- rxGetOption("sampleDataDir")
infile <- file.path(readPath, "events.txt")
hyphensTxt <- RxTextData(infile, delimiter="\t")
events<- rxImport(hyphensTxt)
colnames(events)[1]<-"display_id"
colnames(events)[2]<-"uuid_id"
colnames(events)[3]<-"document_id"
colnames(events)[4]<-"timestamp_id"
colnames(events)[5]<-"platform"
colnames(events)[6]<-"geo_location"
#-------------------------------------------------------
dbinom(3,size=7,p=0.3)+dbinom(4,size=7,p=0.3)+dbinom(5,size=7,p=0.3)+dbinom(6,size=7,p=0.3)+dbinom(7,size=7,p=0.3)
dbinom(92,size=100,p=0.9)