DSR Skilling 6

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

180050007 D.

BALA SWAROOP
SKILLING 6
df<-read.csv("D:\\DSR\\gapminder.csv")
df
library(sparklyr)
library(dplyr)
spark_install(version = "2.1.0")

#a
sc <- spark_connect(master = "local")
sc

#b
install.packages("caTools")
library(caTools)
set.seed(1111)
split = sample.split(data, SplitRatio=0.8)

#c
training_set = subset(data, split == TRUE)
test_set = subset(data, split == FALSE)
split
training_set
test_set

#d
glm.fit <- glm(df$gdp ~ df$population, data = df, family = binomial)

#e
predict(object, newData)

You might also like