Commit 7ff0255f4da7463b9fafa951798ca92590bc61ab

Authored by Zhenghua Gong
1 parent 0200b0f89b
Exists in master

Added the specification of executing entropySorted.R code.

Showing 1 changed file with 12 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 CondIndependentTest.R 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 15
16
17 3. Execute the entropySorted.R code.
18 a.)In Console of R, you type in:
19 source("/home/zgong001/Documents/SprinklerDataset/Rcode/entropySorted.R")
20 The content in "" is the location where you put file entropySorted.R.
21 If there are some errors, you should double check the path is correct.
22 b.)In Console of R, you type in something like the following:
23 EntropySorted(filename = "/home/zgong001/Documents/SprinklerDataset/sprinkler1001.txt", exfilename = "/home/zgong001/Documents/SprinklerDataset/pvalueSorted(sprinkler).xlsx")
24 filename: is the full path and file name of your data file.
25 exfilename: is the full path and excel file name which you want to output your test result.
26
16 Note: The the data in data file could not be integer, for example 0, 1. It should be string, like s0, s1, or good, bad or state0 or state1. 27 Note: The the data in data file could not be integer, for example 0, 1. It should be string, like s0, s1, or good, bad or state0 or state1.