Skip to content

Commit

Permalink
code updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasgerstenberg committed Jun 9, 2024
1 parent 9e36e26 commit a7b82c7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
*.pyc
.Rproj.user
2 changes: 1 addition & 1 deletion code/R/experiments/Experiment.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ df.exp5_summary = df.exp5 %>%
normal_intervention_percentage = mean(normal_intervention == "normal") * 100,
nopreference_intervention_percentage = mean(nopreference_intervention == "no preference") * 100
) %>%
mutate(Outcome = "negative") %>%
mutate(Outcome = "positive") %>%
mutate(Experiment = "fixedint")
write_csv(df.exp5_summary, "../../../data/aggregate/fixedint_pos.csv")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ colnames(df.data)
### Model structure

```{r}
fun.success = function(p_abnormal, p_normal, causal_structure, outcome){
if (causal_structure == "conjunctive"){
p = p_abnormal * p_normal
Expand Down Expand Up @@ -192,10 +191,10 @@ fun.fit_temperature = function(df_data, df_prediction, temperature){
pull(loss)
}
fit.temperature = optim(par = 10,
fit.temperature = optim(par = 10,
fn = fun.fit_temperature,
method = "L-BFGS-B",
lower = 0,
lower = 0,
upper = 100,
df_data = df.intervention,
df_prediction = df.choice)
Expand Down
4 changes: 2 additions & 2 deletions data/aggregate/fixedint_pos.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CausalStructure,abnormal_explanation_percentage,normal_explanation_percentage,nopreference_explanation_percentage,abnormal_intervention_percentage,normal_intervention_percentage,nopreference_intervention_percentage,Outcome,Experiment
Conjunctive,53.535353535353536,9.090909090909092,37.37373737373738,80.8080808080808,11.11111111111111,8.080808080808081,negative,fixedint
Disjunctive,27.27272727272727,18.181818181818183,54.54545454545454,65.65656565656566,12.121212121212121,22.22222222222222,negative,fixedint
Conjunctive,53.535353535353536,9.090909090909092,37.37373737373738,80.8080808080808,11.11111111111111,8.080808080808081,positive,fixedint
Disjunctive,27.27272727272727,18.181818181818183,54.54545454545454,65.65656565656566,12.121212121212121,22.22222222222222,positive,fixedint
Binary file modified figures/plots/bars.pdf
Binary file not shown.
Binary file modified figures/plots/scatter.pdf
Binary file not shown.

0 comments on commit a7b82c7

Please sign in to comment.