Spaces:
Running
Running
Update app.R
Browse files
app.R
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
-
# Script: app_ono.R
|
| 2 |
# setwd("~/Dropbox/OptimizingSI/Analysis/ono")
|
|
|
|
|
|
|
| 3 |
|
| 4 |
options(error = NULL)
|
| 5 |
library(shiny)
|
|
@@ -157,6 +158,7 @@ server <- function(input, output, session) {
|
|
| 157 |
lambda = my_lambda,
|
| 158 |
diff = TRUE,
|
| 159 |
adversarial = FALSE,
|
|
|
|
| 160 |
K = 1L, # Base analysis
|
| 161 |
nSGD = params$nSGD,
|
| 162 |
penalty_type = params$penalty_type,
|
|
@@ -244,13 +246,15 @@ server <- function(input, output, session) {
|
|
| 244 |
|
| 245 |
lambda = my_lambda,
|
| 246 |
diff = TRUE,
|
|
|
|
| 247 |
force_gaussian = FALSE,
|
| 248 |
adversarial = TRUE,
|
| 249 |
-
nFolds_glm = 3L,
|
| 250 |
K = 1L,
|
| 251 |
-
nMonte_adversarial =
|
| 252 |
nSGD = params$nSGD,
|
| 253 |
penalty_type = params$penalty_type,
|
|
|
|
| 254 |
use_optax = params$use_optax,
|
| 255 |
compute_se = params$compute_se,
|
| 256 |
conf_level = params$conf_level,
|
|
@@ -259,8 +263,8 @@ server <- function(input, output, session) {
|
|
| 259 |
)
|
| 260 |
|
| 261 |
# Identify Democrat vs Republican based on "Pro-life" stance
|
| 262 |
-
prolife_probs <- c(Qoptimized$pi_star_point$
|
| 263 |
-
Qoptimized$pi_star_point$
|
| 264 |
which_repub <- which.max(prolife_probs)
|
| 265 |
if (which_repub == 1) {
|
| 266 |
# Swap
|
|
|
|
|
|
|
| 1 |
# setwd("~/Dropbox/OptimizingSI/Analysis/ono")
|
| 2 |
+
# install.packages( "~/Documents/strategize-software/strategize", repos = NULL, type = "source",force = F)
|
| 3 |
+
# Script: app_ono.R
|
| 4 |
|
| 5 |
options(error = NULL)
|
| 6 |
library(shiny)
|
|
|
|
| 158 |
lambda = my_lambda,
|
| 159 |
diff = TRUE,
|
| 160 |
adversarial = FALSE,
|
| 161 |
+
use_regularization = TRUE,
|
| 162 |
K = 1L, # Base analysis
|
| 163 |
nSGD = params$nSGD,
|
| 164 |
penalty_type = params$penalty_type,
|
|
|
|
| 246 |
|
| 247 |
lambda = my_lambda,
|
| 248 |
diff = TRUE,
|
| 249 |
+
use_regularization = TRUE,
|
| 250 |
force_gaussian = FALSE,
|
| 251 |
adversarial = TRUE,
|
| 252 |
+
#nFolds_glm = 3L,
|
| 253 |
K = 1L,
|
| 254 |
+
nMonte_adversarial = 20L,
|
| 255 |
nSGD = params$nSGD,
|
| 256 |
penalty_type = params$penalty_type,
|
| 257 |
+
learning_rate_max = 0.000001,
|
| 258 |
use_optax = params$use_optax,
|
| 259 |
compute_se = params$compute_se,
|
| 260 |
conf_level = params$conf_level,
|
|
|
|
| 263 |
)
|
| 264 |
|
| 265 |
# Identify Democrat vs Republican based on "Pro-life" stance
|
| 266 |
+
prolife_probs <- c(Qoptimized$pi_star_point$Democrat$Position.on.abortion["Pro-life"],
|
| 267 |
+
Qoptimized$pi_star_point$Republican$Position.on.abortion["Pro-life"])
|
| 268 |
which_repub <- which.max(prolife_probs)
|
| 269 |
if (which_repub == 1) {
|
| 270 |
# Swap
|