SHARE
TWEET

Untitled

a guest Aug 20th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // This is a two-point model. So First im predicting rain or no rain (0,1) using logistic regression then using lm model to predict the quantity of rain
  2. mod_LR=glm( Rainfall_LR ~ ., data = train_main[,-8]  , family = binomial(link = logit),offset = Pressure)
  3.  
  4. phat <- predict(mod_LR,test_main , type = "response")
  5. pred <- data.frame(test_main)
  6. logols.fit <- lm(log(Rainfall_Next3)~., train_main[train_main$Rainfall_Next3 > 0, -9])
  7.  
  8. pred$logols <- phat * exp(predict(logols.fit, test_main))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top