Skip to content

Instantly share code, notes, and snippets.

@sherman
Last active August 17, 2017 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sherman/1feae823575dc86a5354a63ab9999482 to your computer and use it in GitHub Desktop.
Save sherman/1feae823575dc86a5354a63ab9999482 to your computer and use it in GitHub Desktop.
Call:
glm(formula = PredictValue ~ HI + BR + Vol + mday + wday, family = binomial(link = "logit"),
data = train, na.action = "na.exclude")
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7719 -1.1056 -0.7567 1.1626 1.7096
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -12.91453 324.74416 -0.040 0.96828
HITRUE 0.45297 0.27386 1.654 0.09813
BR1 -0.27223 0.13269 -2.052 0.04021 * - brent, (close - open)
Vol 1.09640 0.84043 1.305 0.19204
mday2 0.84098 0.54471 1.544 0.12261
mday3 0.36857 0.53584 0.688 0.49156
mday4 0.31662 0.54887 0.577 0.56404
mday5 0.46437 0.53104 0.874 0.38187
mday6 1.43370 0.55422 2.587 0.00968 ** - 6 день месяца
mday7 0.84815 0.54731 1.550 0.12122
mday8 0.44385 0.54494 0.814 0.41536
mday9 0.19402 0.54220 0.358 0.72047
mday10 0.31292 0.52787 0.593 0.55331
mday11 0.62069 0.53426 1.162 0.24533
mday12 0.10654 0.54815 0.194 0.84589
mday13 1.47491 0.55280 2.668 0.00763 ** - 13 день месяца
mday14 0.46868 0.53182 0.881 0.37817
mday15 1.23177 0.55128 2.234 0.02546 *
mday16 0.75166 0.53050 1.417 0.15651
mday17 0.52328 0.52849 0.990 0.32211
mday18 -0.27044 0.54778 -0.494 0.62151
mday19 0.26033 0.53083 0.490 0.62384
mday20 0.60638 0.52809 1.148 0.25087
mday21 0.74002 0.53715 1.378 0.16830
mday22 0.21478 0.53953 0.398 0.69057
mday23 0.26690 0.53500 0.499 0.61787
mday24 0.47653 0.52774 0.903 0.36655
mday25 0.18128 0.53570 0.338 0.73505
mday26 -0.06555 0.53820 -0.122 0.90306
mday27 -0.19334 0.54010 -0.358 0.72036
mday28 0.34553 0.53205 0.649 0.51606
mday29 0.42750 0.54241 0.788 0.43061
mday30 0.16579 0.54032 0.307 0.75896
mday31 0.43723 0.64707 0.676 0.49922
wday1 12.68585 324.74393 0.039 0.96884
wday2 12.63665 324.74392 0.039 0.96896
wday3 12.25958 324.74391 0.038 0.96989
wday4 12.59046 324.74392 0.039 0.96907
wday5 12.42069 324.74391 0.038 0.96949
wday6 11.73706 324.74600 0.036 0.97117
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1431.6 on 1032 degrees of freedom
Residual deviance: 1370.6 on 993 degrees of freedom
AIC: 1450.6
Number of Fisher Scoring iterations: 1
```{r}
result <- predict(model, train, type = "response", na.action = "na.exclude")
result <- ifelse(result > 0.5, 1, 0)
result <- as.integer(result != train$PredictValue)
1 - mean(result[!is.na(result)])
result <- predict(model, test, type = "response", na.action = "na.exclude")
result <- ifelse(result > 0.5, 1, 0)
result <- as.integer(result !=test$PredictValue)
1 - mean(result[!is.na(result)])
train: [1] 0.6108422
test: [1] 0.5391304
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment