Skip to content

Commit

Permalink
rhmm models
Browse files Browse the repository at this point in the history
  • Loading branch information
rcabanasdepaz committed Sep 13, 2021
1 parent 413866c commit 5c4ab93
Show file tree
Hide file tree
Showing 723 changed files with 31,948 additions and 34 deletions.
23 changes: 8 additions & 15 deletions papers/neurips21/modelGen.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
package neurips21;

import ch.idsia.credici.IO;
import ch.idsia.credici.inference.CredalCausalApproxLP;
import ch.idsia.credici.inference.CredalCausalVE;
import ch.idsia.credici.model.StructuralCausalModel;
import ch.idsia.credici.model.builder.ChainGenerator;
import ch.idsia.credici.model.builder.TreeGenerator;
import ch.idsia.credici.model.predefined.RandomChainNonMarkovian;
import ch.idsia.credici.model.builder.ReverseHMM;
import ch.idsia.credici.utility.DataUtil;
import ch.idsia.credici.utility.FactorUtil;
import ch.idsia.crema.data.WriterCSV;
import ch.idsia.crema.factor.credal.vertex.VertexFactor;
import ch.idsia.crema.model.ObservationBuilder;
import ch.idsia.crema.utility.RandomUtil;
import gnu.trove.map.TIntIntMap;

import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

Expand All @@ -26,18 +19,18 @@ public class modelGen {
//static String wdir = "/Users/rcabanas/GoogleDrive/IDSIA/causality/dev/credici/";
static String wdir = "./";
static String modelFolder = "papers/neurips21/models/";
static String set = "st";
static String fcount = "";
static String set = "sr";
static String fcount = "_2";



public static void main(String[] args) throws IOException, InterruptedException {

// set1
String[] topologies = new String[]{"tree"};
int[] treeWidthExo = new int[]{0}; //
String[] topologies = new String[]{"rhmm"};
int[] treeWidthExo = new int[]{0,1,2}; //
int[] numEndogenous = new int[]{5,7,10};
int[] index = IntStream.range(0,20).toArray();
int[] index = IntStream.range(20,40).toArray();



Expand Down Expand Up @@ -87,8 +80,8 @@ private static void buildModel(String top, int twExo, int nEndo, int idx, boolea
do {
feasible = true;

if(top == "tree")
m = ChainGenerator.build(nEndo, twExo, maxDist);
if(top == "rhmm")
m = ReverseHMM.build(nEndo, twExo, maxDist);
else // chain
m = ChainGenerator.build(nEndo, twExo, maxDist);

Expand Down
45 changes: 45 additions & 0 deletions papers/neurips21/models/sr0/rhmm_twExo0_nEndo10_0.uai
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CAUSAL
20
2 2 2 2 2 2 2 2 2 2 5 3 9 3 9 3 9 3 9 3
20
3 10 1 0
2 11 1
4 12 3 0 2
2 13 3
4 14 5 2 4
2 15 5
4 16 7 4 6
2 17 7
4 18 9 6 8
2 19 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19

10 0 1 0 0 0 0 0 1 0 1
3 1 0 1
36 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 0 0 0 1 1 1 0 1 1 1 1 1
3 1 0 0
36 0 1 0 0 1 1 0 1 1 1 1 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1
3 1 1 0
36 0 0 0 1 1 0 1 0 0 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 0 1 0 0 1
3 0 1 1
36 0 0 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 1 1
3 0 0 1
5 0.87 0.018 0.016 0.058 0.038
3 0.267 0.226 0.507
9 0.016 0.01 0.721 0.002 0.008 0.001 0.073 0.001 0.168
3 0.66 0.137 0.203
9 0.008 0.378 0.01 0.002 0.002 0.139 0.218 0.242 0.001
3 0.178 0.626 0.196
9 0.328 0.003 0.001 0.46 0.002 0.001 0.002 0.001 0.202
3 0.382 0.518 0.1
9 0.006 0.021 0.021 0.463 0.038 0.006 0.338 0.004 0.103
3 0.119 0.298 0.583
45 changes: 45 additions & 0 deletions papers/neurips21/models/sr0/rhmm_twExo0_nEndo10_1.uai
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CAUSAL
20
2 2 2 2 2 2 2 2 2 2 5 3 9 3 9 3 9 3 9 3
20
3 10 1 0
2 11 1
4 12 3 0 2
2 13 3
4 14 5 2 4
2 15 5
4 16 7 4 6
2 17 7
4 18 9 6 8
2 19 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19

10 0 0 1 0 0 1 1 1 0 0
3 0 1 0
36 0 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 0 0 1 1 1
3 1 0 1
36 1 0 0 0 0 0 0 0 1 1 1 0 1 0 1 0 0 0 0 0 1 1 0 0 1 1 0 1 1 0 1 1 0 0 1 0
3 1 1 0
36 0 1 1 0 0 1 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 1 1 1 1
3 0 1 0
36 1 0 1 1 1 1 1 1 0 0 0 0 1 0 1 0 0 1 0 1 1 1 1 1 0 0 1 0 0 1 1 1 0 1 1 1
3 1 0 0
5 0.305 0.508 0.058 0.123 0.006
3 0.031 0.139 0.83
9 0.774 0.018 0.002 0.002 0.006 0.02 0.01 0.005 0.163
3 0.318 0.602 0.08
9 0.003 0.409 0.007 0.001 0.247 0.072 0.005 0.247 0.009
3 0.438 0.441 0.121
9 0.362 0.005 0.001 0.001 0.003 0.59 0.003 0.006 0.029
3 0.118 0.055 0.827
9 0.003 0.006 0.058 0.126 0.005 0.05 0.719 0.027 0.006
3 0.186 0.78 0.034
45 changes: 45 additions & 0 deletions papers/neurips21/models/sr0/rhmm_twExo0_nEndo10_10.uai
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CAUSAL
20
2 2 2 2 2 2 2 2 2 2 5 3 9 3 9 3 9 3 9 3
20
3 10 1 0
2 11 1
4 12 3 0 2
2 13 3
4 14 5 2 4
2 15 5
4 16 7 4 6
2 17 7
4 18 9 6 8
2 19 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19

10 1 0 0 1 1 0 1 1 1 1
3 0 1 0
36 0 1 0 1 1 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 0 0 1 1 0 1 1 1 1 0 1 1
3 0 1 1
36 1 0 0 1 1 1 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1 0 1 1 0 1 0 0 1 1 0
3 0 1 0
36 1 1 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 0 1 0 0 1 0 1 1 1 1 1 0 1 1 0 1 1 1 0
3 0 0 1
36 1 1 0 1 1 1 0 1 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 0
3 0 0 1
5 0.46 0.117 0.118 0.163 0.142
3 0.006 0.037 0.957
9 0.057 0.004 0.003 0.023 0.091 0.014 0.017 0.788 0.003
3 0.808 0.164 0.028
9 0.077 0.297 0.002 0.031 0.062 0.331 0.133 0.052 0.015
3 0.884 0.075 0.041
9 0.002 0.002 0.119 0.001 0.002 0.001 0.001 0.026 0.846
3 0.006 0.951 0.043
9 0.011 0.002 0.704 0.003 0.239 0.005 0.001 0.001 0.034
3 0.252 0.038 0.71
45 changes: 45 additions & 0 deletions papers/neurips21/models/sr0/rhmm_twExo0_nEndo10_11.uai
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CAUSAL
20
2 2 2 2 2 2 2 2 2 2 5 3 9 3 9 3 9 3 9 3
20
3 10 1 0
2 11 1
4 12 3 0 2
2 13 3
4 14 5 2 4
2 15 5
4 16 7 4 6
2 17 7
4 18 9 6 8
2 19 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19

10 1 0 1 1 1 0 1 1 0 0
3 1 0 1
36 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 1 1 1 0 1 1 1 0 1 0 0 1 0 1 1 0 1 1 1 1 1
3 1 0 0
36 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 1 0 0
3 1 0 0
36 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 1 1 1 1 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0
3 0 1 0
36 1 1 1 0 1 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1
3 1 0 1
5 0.004 0.638 0.234 0.001 0.123
3 0.156 0.186 0.658
9 0.002 0.752 0.001 0.002 0.035 0.009 0.001 0.177 0.021
3 0.153 0.795 0.052
9 0.21 0.025 0.139 0.238 0.01 0.016 0.216 0.113 0.033
3 0.167 0.296 0.537
9 0.002 0.001 0.001 0.989 0.001 0.001 0.002 0.002 0.001
3 0.152 0.053 0.795
9 0.489 0.022 0.001 0.002 0.001 0.08 0.001 0.403 0.001
3 0.141 0.017 0.842
45 changes: 45 additions & 0 deletions papers/neurips21/models/sr0/rhmm_twExo0_nEndo10_12.uai
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CAUSAL
20
2 2 2 2 2 2 2 2 2 2 5 3 9 3 9 3 9 3 9 3
20
3 10 1 0
2 11 1
4 12 3 0 2
2 13 3
4 14 5 2 4
2 15 5
4 16 7 4 6
2 17 7
4 18 9 6 8
2 19 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19

10 1 0 1 0 0 0 1 1 0 0
3 1 0 1
36 1 0 1 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1
3 0 0 1
36 1 1 1 0 0 1 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 0 1 0 1 0 1
3 1 0 1
36 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1 0 1 0 0 0 0 1 1 1 0 1 1 0 1 1
3 1 0 0
36 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 1
3 1 0 0
5 0.1 0.107 0.518 0.089 0.186
3 0.314 0.192 0.494
9 0.391 0.054 0.256 0.001 0.008 0.065 0.003 0.008 0.214
3 0.196 0.453 0.351
9 0.041 0.001 0.226 0.002 0.011 0.715 0.002 0.001 0.001
3 0.386 0.58 0.034
9 0.01 0.078 0.359 0.147 0.185 0.003 0.006 0.007 0.205
3 0.082 0.748 0.17
9 0.248 0.731 0.001 0.001 0.001 0.004 0.002 0.011 0.001
3 0.445 0.336 0.219
45 changes: 45 additions & 0 deletions papers/neurips21/models/sr0/rhmm_twExo0_nEndo10_13.uai
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CAUSAL
20
2 2 2 2 2 2 2 2 2 2 5 3 9 3 9 3 9 3 9 3
20
3 10 1 0
2 11 1
4 12 3 0 2
2 13 3
4 14 5 2 4
2 15 5
4 16 7 4 6
2 17 7
4 18 9 6 8
2 19 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19

10 1 0 1 1 0 1 1 1 1 1
3 1 0 0
36 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0
3 1 1 0
36 1 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 1 1 1 0 0 0 0 1 0 1 0 1 1 1 1 0
3 1 0 0
36 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 1
3 0 0 1
36 0 1 0 0 1 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1
3 0 1 0
5 0.036 0.062 0.099 0.661 0.142
3 0.217 0.432 0.351
9 0.002 0.006 0.63 0.002 0.002 0.355 0.001 0.001 0.001
3 0.055 0.607 0.338
9 0.001 0.057 0.141 0.015 0.004 0.323 0.267 0.164 0.028
3 0.522 0.234 0.244
9 0.001 0.294 0.123 0.002 0.057 0.187 0.239 0.096 0.001
3 0.135 0.273 0.592
9 0.006 0.001 0.002 0.001 0.001 0.001 0.006 0.001 0.981
3 0.577 0.418 0.005
45 changes: 45 additions & 0 deletions papers/neurips21/models/sr0/rhmm_twExo0_nEndo10_14.uai
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CAUSAL
20
2 2 2 2 2 2 2 2 2 2 5 3 9 3 9 3 9 3 9 3
20
3 10 1 0
2 11 1
4 12 3 0 2
2 13 3
4 14 5 2 4
2 15 5
4 16 7 4 6
2 17 7
4 18 9 6 8
2 19 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19

10 1 0 0 1 0 0 0 1 1 0
3 1 0 0
36 1 1 1 0 1 1 0 1 0 1 0 0 0 0 1 1 0 0 1 0 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 0
3 0 1 0
36 1 1 1 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 1
3 1 1 0
36 0 0 1 0 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 0 1 1 0
3 0 1 1
36 1 0 1 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 0 1 0 0 1 0 0 1
3 1 0 1
5 0.038 0.047 0.243 0.545 0.127
3 0.109 0.186 0.705
9 0.149 0.003 0.003 0.003 0.002 0.04 0.006 0.788 0.006
3 0.178 0.631 0.191
9 0.562 0.22 0.097 0.081 0.023 0.009 0.001 0.006 0.001
3 0.099 0.026 0.875
9 0.737 0.048 0.045 0.09 0.003 0.01 0.005 0.002 0.06
3 0.524 0.301 0.175
9 0.104 0.256 0.21 0.026 0.001 0.004 0.196 0.102 0.101
3 0.4 0.179 0.421
Loading

0 comments on commit 5c4ab93

Please sign in to comment.