
Last chance! 50% off unlimited learning
Sale ends in
Define a function that can be used to feed data into speedglm and biglm
make_glm_streaming_fn(data, verbose = FALSE)
return a function, fn, that can be used as the data argument in biglm::bigglm or speedglm::shglm
a disk.frame
Whether to print the status of data loading. Default to FALSE
Other Machine Learning (ML):
dfglm()
cars.df = as.disk.frame(cars)
streamacq = make_glm_streaming_fn(cars.df, verbose = FALSE)
majorv = as.integer(version$major)
minorv = as.integer(strsplit(version$minor, ".", fixed=TRUE)[[1]][1])
if(((majorv == 3) & (minorv >= 6)) | (majorv > 3)) {
m = biglm::bigglm(dist ~ speed, data = streamacq)
summary(m)
predict(m, get_chunk(cars.df, 1))
predict(m, collect(cars.df, 1))
} else {
m = speedglm::shglm(dist ~ speed, data = streamacq)
}
Run the code above in your browser using DataLab