Commit 671da0d26adad8559e982aae0cd027874b36c70e

Authored by Zhenghua Gong
1 parent 876023d7b8
Exists in master

Added Note.

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
1 1. To execute the R code of CondIndependentTest.R, you need do some preparation. 1 1. To execute the R code of CondIndependentTest.R, you need do some preparation.
2 a.) Install package "bnlearn" in R, (because I used "bnlearn" package in my code.): 2 a.) Install package "bnlearn" in R, (because I used "bnlearn" package in my code.):
3 install.packages(​"http://www.bnlearn.com/releases/​bnlearn_latest.tar.gz") 3 install.packages(​"http://www.bnlearn.com/releases/​bnlearn_latest.tar.gz")
4 b.) Download file CondIndependentTest.R and put it in a folder (For example, put it in folder "/home/zgong001/Documents/SprinklerDataset/CondIndependentTest.R"). 4 b.) Download file CondIndependentTest.R and put it in a folder (For example, put it in folder "/home/zgong001/Documents/SprinklerDataset/CondIndependentTest.R").
5 2. Execute the code. 5 2. Execute the code.
6 a.)In Console of R, you type in: 6 a.)In Console of R, you type in:
7 source("/home/zgong001/Documents/SprinklerDataset/Rcode/CondIndependentTest.R") 7 source("/home/zgong001/Documents/SprinklerDataset/Rcode/CondIndependentTest.R")
8 The content in "" is the location where you put file CondIndependentTest.R. 8 The content in "" is the location where you put file CondIndependentTest.R.
9 If there are some errors, you should double check the path is correct. 9 If there are some errors, you should double check the path is correct.
10 b.)In Console of R, you type in something like the following: 10 b.)In Console of R, you type in something like the following:
11 CondIndTwoVar(filename = "/home/zgong001/Documents/SprinklerDataset/sprinkler1001.txt", methodu="x2", exfilename = "/home/zgong001/Documents/SprinklerDataset/pvalueSorted(sprinkler).xlsx") 11 CondIndTwoVar(filename = "/home/zgong001/Documents/SprinklerDataset/sprinkler1001.txt", methodu="x2", exfilename = "/home/zgong001/Documents/SprinklerDataset/pvalueSorted(sprinkler).xlsx")
12 filename: is the full path and file name of your data file. 12 filename: is the full path and file name of your data file.
13 methoudu: is the method you'll choose to do conditional independence test. You could choose "x2" or "mi". "x2" means Chi-Square Test of Independence and "mi" means mutual information test. 13 methoudu: is the method you'll choose to do conditional independence test. You could choose "x2" or "mi". "x2" means Chi-Square Test of Independence and "mi" means mutual information test.
14 exfilename: is the full path and excel file name which you want to output your test result.
14 exfilename: is the full path and excel file name which you want to output your test result.
15