Closed azmfaridee closed 11 years ago
A nice tutorial about Information Gain and Gain Ratio is here:
There are also measures like GINI Index, Chi Square Test etc. that can be implemented as well. What I'm trying to do, is parameterize, so that user can switch which measure he/she wants to use for split criteria calculation.
@kdiverson An excerpt from the book Machine Learning by Tom Mitchell would clear things up a bit more.
Reason for favoring Gain Ratio (Page 73)
There is a natural bias in the information gain measure that favors attributes with many values over those with few values. As an extreme example, consider the attribute Date, which has a very large number of possible values (e.g., March 4, 1979). If we were to add this attribute to the data in Table 3.2, it would have the highest information gain of any of the attributes. This is because Date alone perfectly predicts the target attribute over the training data. Thus, it would be selected as the decision attribute for the root node of the tree and lead to a (quite broad) tree of depth one, which perfectly classifies the training data. Of course, this decision tree would fare poorly on subsequent examples, because it is not a useful predictor despite the fact that it perfectly separates the training data.
What is wrong with the attribute Date? Simply put, it has so many possible values that it is bound to separate the training examples into very small subsets. Because of this, it will have a very high information gain relative to the training examples, despite being a very poor predictor of the target function over unseen instances.
One way to avoid this difficulty is to select decision attributes based on some measure other than information gain. One alternative measure that has been used successfully is the gain ratio (Quinlan 1986). The gain ratio measure penalizes attributes such as Date by incorporating a term, called split informution, that is sensitive to how broadly and uniformly the attribute splits the data.
Reason for avoiding Gain Ratio (Page 74)
One practical issue that arises in using GainRatio in place of Gain to select attributes is that the denominator can be zero or very small when ISi 1 x IS1 for one of the Si. This either makes the GainRatio undefined or very large for attributes that happen to have the same value for nearly all members of S. To avoid selecting attributes purely on this basis, we can adopt some heuristic such as first calculating the Gain of each attribute, then applying the GainRatio test only considering those attributes with above average Gain (Quinlan 1986).
@kdiverson What do you think we should do? On a side note, the Regularized Random Forest paper uses Gain Ratio as it's splitting criteria, but from the book, it's evident that Gain Ratio has some pitfalls too. We've been using Information Gain all these time, I could implement Gain Ratio, but I don't have much idea about the heuristics that the authors is talking about, so depending on the implementation, it might behave poorly in contrast to Information Gain, which exactly opposite of what it's supposed to do.
@kdiverson The book is in the Dropbox folder titled 'Book', you might want to take a look at it to understand some of the notations that are garbled up here.
@darthxaher thanks for that info, the example helped. I'll have a look at that books as well. Have you looked at what other people are doing for microarray data? One suggestion is to use the expected prediction error (EPE) of the model to make sure the OTUs selected by the model are not a lucky guess. We might try both information gain, the gain ratio and a combination of both and look at EPEs. I'm not sure about the heuristic, I'll have a look at that book and get back to you.
@kdiverson I've been running the GainRatio code in inpatient.final.an.0.03.subsample.avg.matrix
data, since we have performance measure from previous runs of information gain. Look carefully on these two runs for 100 trees.
len(self.globalOutOfBagEstimates): 187
numCorrect 132
forrestErrorRate: 0.294117647059
calcForrestVariableImportance()
globalVariableRanks: [[9, 4.31], [2, 0.46], [182, 0.39], [27, 0.28], [24, 0.27], [264, 0.25], [31, 0.24], [88, 0.18], [7, 0.14], [14, 0.14], [33, 0.14], [41, 0.14], [151, 0.14], [100, 0.13], [145, 0.13], [158, 0.13], [16, 0.12], [114, 0.12], [39, 0.1], [40, 0.1], [64, 0.1], [37, 0.09], [43, 0.09], [23, 0.08], [34, 0.08], [140, 0.08], [180, 0.08], [51, 0.07], [69, 0.07], [77, 0.07], [98, 0.07], [159, 0.07], [161, 0.07], [36, 0.06], [86, 0.06], [91, 0.06], [11, 0.05], [12, 0.05], [49, 0.05], [82, 0.05], [157, 0.05], [228, 0.05], [293, 0.05], [373, 0.05], [378, 0.05], [468, 0.05], [677, 0.05], [10, 0.04], [55, 0.04], [58, 0.04], [76, 0.04], [127, 0.04], [371, 0.04], [390, 0.04], [568, 0.04], [702, 0.04], [35, 0.03], [42, 0.03], [65, 0.03], [72, 0.03], [74, 0.03], [85, 0.03], [125, 0.03], [133, 0.03], [144, 0.03], [156, 0.03], [176, 0.03], [204, 0.03], [234, 0.03], [254, 0.03], [314, 0.03], [421, 0.03], [523, 0.03], [638, 0.03], [639, 0.03], [737, 0.03], [25, 0.02], [32, 0.02], [44, 0.02], [52, 0.02], [56, 0.02], [60, 0.02], [92, 0.02], [104, 0.02], [128, 0.02], [141, 0.02], [143, 0.02], [163, 0.02], [168, 0.02], [196, 0.02], [200, 0.02], [226, 0.02], [232, 0.02], [253, 0.02], [261, 0.02], [268, 0.02], [279, 0.02], [280, 0.02], [296, 0.02], [302, 0.02], [320, 0.02], [346, 0.02], [423, 0.02], [467, 0.02], [636, 0.02], [643, 0.02], [679, 0.02], [4, 0.01], [68, 0.01], [73, 0.01], [84, 0.01], [87, 0.01], [117, 0.01], [118, 0.01], [123, 0.01], [175, 0.01], [184, 0.01], [191, 0.01], [195, 0.01], [230, 0.01], [231, 0.01], [247, 0.01], [260, 0.01], [266, 0.01], [273, 0.01], [281, 0.01], [330, 0.01], [334, 0.01], [336, 0.01], [338, 0.01], [347, 0.01], [348, 0.01], [360, 0.01], [382, 0.01], [389, 0.01], [400, 0.01], [414, 0.01], [427, 0.01], [430, 0.01], [431, 0.01], [433, 0.01], [497, 0.01], [532, 0.01], [562, 0.01], [598, 0.01], [642, 0.01], [673, 0.01], [715, 0.01]]
real 12m7.958s
user 11m59.023s
sys 0m2.100s
len(self.globalOutOfBagEstimates): 187
numCorrect 134
forrestErrorRate: 0.283422459893
calcForrestVariableImportance()
globalVariableRanks: [[9, 4.19], [2, 0.72], [14, 0.31], [182, 0.28], [41, 0.25], [34, 0.23], [36, 0.22], [43, 0.22], [86, 0.22], [16, 0.21], [89, 0.2], [264, 0.19], [31, 0.17], [204, 0.15], [64, 0.14], [112, 0.14], [141, 0.12], [22, 0.11], [57, 0.11], [67, 0.11], [140, 0.11], [32, 0.1], [39, 0.1], [73, 0.09], [91, 0.09], [228, 0.09], [302, 0.09], [7, 0.08], [27, 0.08], [158, 0.08], [161, 0.08], [286, 0.08], [421, 0.08], [10, 0.07], [26, 0.07], [58, 0.07], [74, 0.07], [11, 0.06], [23, 0.06], [68, 0.06], [145, 0.05], [183, 0.05], [230, 0.05], [21, 0.04], [33, 0.04], [61, 0.04], [77, 0.04], [85, 0.04], [119, 0.04], [125, 0.04], [129, 0.04], [156, 0.04], [175, 0.04], [234, 0.04], [296, 0.04], [362, 0.04], [568, 0.04], [28, 0.03], [42, 0.03], [44, 0.03], [49, 0.03], [54, 0.03], [98, 0.03], [100, 0.03], [128, 0.03], [133, 0.03], [154, 0.03], [417, 0.03], [572, 0.03], [686, 0.03], [47, 0.02], [50, 0.02], [70, 0.02], [72, 0.02], [82, 0.02], [87, 0.02], [93, 0.02], [102, 0.02], [114, 0.02], [144, 0.02], [151, 0.02], [195, 0.02], [215, 0.02], [220, 0.02], [224, 0.02], [232, 0.02], [240, 0.02], [256, 0.02], [265, 0.02], [308, 0.02], [340, 0.02], [371, 0.02], [387, 0.02], [412, 0.02], [444, 0.02], [456, 0.02], [468, 0.02], [673, 0.02], [1, 0.01], [6, 0.01], [15, 0.01], [17, 0.01], [25, 0.01], [48, 0.01], [52, 0.01], [60, 0.01], [75, 0.01], [78, 0.01], [84, 0.01], [90, 0.01], [113, 0.01], [115, 0.01], [116, 0.01], [120, 0.01], [121, 0.01], [126, 0.01], [127, 0.01], [148, 0.01], [157, 0.01], [159, 0.01], [168, 0.01], [180, 0.01], [187, 0.01], [188, 0.01], [216, 0.01], [227, 0.01], [253, 0.01], [275, 0.01], [279, 0.01], [280, 0.01], [297, 0.01], [319, 0.01], [322, 0.01], [325, 0.01], [327, 0.01], [334, 0.01], [347, 0.01], [357, 0.01], [372, 0.01], [389, 0.01], [405, 0.01], [406, 0.01], [409, 0.01], [416, 0.01], [420, 0.01], [429, 0.01], [445, 0.01], [472, 0.01], [518, 0.01], [598, 0.01], [615, 0.01], [638, 0.01], [678, 0.01], [679, 0.01]]
real 12m23.428s
user 12m5.239s
sys 0m2.538s
Two observations:
Now look what happens when I run the algo with 1000 trees.
len(self.globalOutOfBagEstimates): 187
numCorrect 136
forrestErrorRate: 0.272727272727
calcForrestVariableImportance()
globalVariableRanks: [[9, 4.57], [2, 0.783], [264, 0.23], [43, 0.199], [33, 0.17], [182, 0.169], [27, 0.143], [41, 0.139], [7, 0.135], [16, 0.128], [14, 0.126], [31, 0.119], [145, 0.118], [158, 0.111], [32, 0.11], [39, 0.109], [11, 0.102], [86, 0.097], [140, 0.09], [58, 0.081], [112, 0.079], [133, 0.073], [100, 0.069], [91, 0.068], [34, 0.064], [161, 0.064], [184, 0.06], [302, 0.056], [141, 0.055], [228, 0.055], [68, 0.054], [36, 0.053], [117, 0.053], [37, 0.052], [26, 0.051], [60, 0.051], [88, 0.051], [129, 0.051], [105, 0.045], [85, 0.043], [114, 0.042], [127, 0.041], [82, 0.04], [25, 0.037], [157, 0.037], [79, 0.035], [98, 0.035], [151, 0.035], [174, 0.035], [44, 0.034], [57, 0.034], [285, 0.034], [22, 0.033], [84, 0.033], [47, 0.032], [73, 0.032], [407, 0.032], [64, 0.03], [125, 0.03], [144, 0.03], [234, 0.03], [61, 0.027], [70, 0.027], [468, 0.027], [10, 0.026], [78, 0.025], [254, 0.025], [256, 0.023], [72, 0.022], [74, 0.022], [371, 0.022], [154, 0.021], [187, 0.021], [51, 0.02], [156, 0.02], [40, 0.019], [432, 0.019], [568, 0.019], [52, 0.018], [101, 0.018], [155, 0.018], [427, 0.018], [21, 0.017], [128, 0.017], [636, 0.017], [12, 0.016], [23, 0.016], [176, 0.016], [255, 0.016], [642, 0.016], [28, 0.015], [65, 0.015], [119, 0.015], [148, 0.015], [204, 0.015], [280, 0.015], [296, 0.015], [405, 0.015], [456, 0.015], [562, 0.015], [13, 0.014], [230, 0.014], [346, 0.014], [17, 0.013], [42, 0.013], [276, 0.013], [421, 0.013], [56, 0.012], [554, 0.012], [673, 0.012], [737, 0.012], [69, 0.011], [390, 0.011], [77, 0.01], [314, 0.01], [224, 0.009], [334, 0.009], [414, 0.009], [682, 0.009], [297, 0.007], [304, 0.007], [313, 0.007], [389, 0.007], [630, 0.007], [677, 0.007], [679, 0.007], [191, 0.006], [195, 0.006], [261, 0.006], [262, 0.006], [327, 0.006], [338, 0.006], [347, 0.006], [412, 0.006], [418, 0.006], [458, 0.006], [532, 0.006], [569, 0.006], [633, 0.006], [638, 0.006], [785, 0.006], [24, 0.005], [35, 0.005], [102, 0.005], [279, 0.005], [308, 0.005], [387, 0.005], [406, 0.005], [46, 0.004], [49, 0.004], [83, 0.004], [90, 0.004], [116, 0.004], [142, 0.004], [259, 0.004], [281, 0.004], [320, 0.004], [326, 0.004], [348, 0.004], [357, 0.004], [379, 0.004], [572, 0.004], [702, 0.004], [93, 0.003], [126, 0.003], [143, 0.003], [220, 0.003], [231, 0.003], [243, 0.003], [260, 0.003], [287, 0.003], [416, 0.003], [420, 0.003], [444, 0.003], [89, 0.002], [97, 0.002], [103, 0.002], [109, 0.002], [202, 0.002], [214, 0.002], [286, 0.002], [380, 0.002], [518, 0.002], [728, 0.002], [107, 0.001], [152, 0.001], [159, 0.001], [268, 0.001], [325, 0.001], [339, 0.001], [381, 0.001], [400, 0.001], [586, 0.001], [615, 0.001]]
real 127m51.934s
user 126m25.961s
sys 0m19.271s
len(self.globalOutOfBagEstimates): 187
numCorrect 139
forrestErrorRate: 0.256684491979
calcForrestVariableImportance()
globalVariableRanks: [[9, 4.487], [2, 0.87], [264, 0.278], [182, 0.162], [31, 0.161], [14, 0.159], [11, 0.15], [7, 0.144], [41, 0.117], [43, 0.115], [158, 0.111], [86, 0.109], [33, 0.1], [16, 0.098], [145, 0.097], [100, 0.095], [151, 0.094], [88, 0.088], [27, 0.083], [112, 0.08], [140, 0.078], [34, 0.077], [60, 0.075], [22, 0.073], [91, 0.072], [26, 0.071], [141, 0.067], [144, 0.067], [129, 0.066], [157, 0.066], [32, 0.065], [71, 0.062], [105, 0.062], [228, 0.06], [36, 0.059], [114, 0.059], [68, 0.058], [72, 0.055], [47, 0.054], [37, 0.053], [40, 0.053], [77, 0.052], [133, 0.05], [161, 0.05], [57, 0.049], [12, 0.048], [159, 0.047], [52, 0.044], [24, 0.042], [82, 0.042], [74, 0.038], [64, 0.037], [23, 0.036], [84, 0.036], [39, 0.035], [302, 0.035], [73, 0.034], [117, 0.033], [285, 0.033], [89, 0.032], [155, 0.031], [230, 0.029], [65, 0.028], [195, 0.027], [187, 0.026], [21, 0.024], [371, 0.024], [70, 0.023], [125, 0.023], [254, 0.023], [280, 0.023], [42, 0.022], [255, 0.022], [568, 0.022], [17, 0.021], [127, 0.021], [258, 0.021], [29, 0.02], [204, 0.02], [405, 0.02], [572, 0.02], [468, 0.019], [119, 0.018], [234, 0.018], [148, 0.016], [286, 0.016], [427, 0.016], [87, 0.015], [224, 0.015], [562, 0.015], [85, 0.014], [407, 0.014], [421, 0.014], [35, 0.013], [98, 0.013], [339, 0.013], [414, 0.013], [456, 0.013], [458, 0.013], [51, 0.012], [93, 0.012], [276, 0.012], [304, 0.012], [347, 0.012], [435, 0.012], [642, 0.012], [58, 0.011], [296, 0.011], [308, 0.011], [615, 0.011], [13, 0.01], [44, 0.01], [360, 0.01], [406, 0.01], [432, 0.01], [142, 0.009], [184, 0.009], [226, 0.009], [297, 0.009], [338, 0.009], [785, 0.009], [334, 0.008], [409, 0.008], [554, 0.008], [630, 0.008], [639, 0.008], [673, 0.008], [61, 0.007], [178, 0.007], [277, 0.007], [444, 0.007], [532, 0.007], [633, 0.007], [643, 0.007], [677, 0.007], [69, 0.006], [196, 0.006], [212, 0.006], [231, 0.006], [256, 0.006], [357, 0.006], [379, 0.006], [679, 0.006], [165, 0.005], [174, 0.005], [202, 0.005], [243, 0.005], [260, 0.005], [314, 0.005], [426, 0.005], [467, 0.005], [514, 0.005], [139, 0.004], [175, 0.004], [220, 0.004], [273, 0.004], [279, 0.004], [346, 0.004], [387, 0.004], [389, 0.004], [399, 0.004], [494, 0.004], [638, 0.004], [79, 0.003], [81, 0.003], [83, 0.003], [128, 0.003], [156, 0.003], [200, 0.003], [213, 0.003], [281, 0.003], [320, 0.003], [381, 0.003], [412, 0.003], [430, 0.003], [569, 0.003], [636, 0.003], [737, 0.003], [50, 0.002], [124, 0.002], [188, 0.002], [191, 0.002], [261, 0.002], [262, 0.002], [287, 0.002], [315, 0.002], [322, 0.002], [348, 0.002], [420, 0.002], [518, 0.002], [719, 0.002], [728, 0.002], [116, 0.001], [121, 0.001], [168, 0.001], [207, 0.001], [250, 0.001], [278, 0.001], [289, 0.001], [313, 0.001], [326, 0.001], [331, 0.001], [340, 0.001], [416, 0.001], [623, 0.001], [627, 0.001], [682, 0.001], [686, 0.001], [702, 0.001]]
real 144m2.802s
user 132m17.689s
sys 0m30.592s
Now some observations again:
Have you looked at what other people are doing for microarray data? One suggestion is to use the expected prediction error (EPE) of the model to make sure the OTUs selected by the model are not a lucky guess. We might try both information gain, the gain ratio and a combination of both and look at EPEs. I'm not sure about the heuristic, I'll have a look at that book and get back to you.
@kdiverson let me know what you can find out.
OK time for another test case analysis. Testing for outin.final.an.0.03.subsample.avg.matrix
data. WIth two run with 100 trees. I'm using Gain Ratio.
len(self.globalOutOfBagEstimates): 341
numCorrect 321
forrestErrorRate: 0.058651026393
calcForrestVariableImportance()
globalVariableRanks: [[217, 2.73], [152, 1.99], [147, 1.94], [2, 1.55], [43, 1.54], [6, 1.44], [148, 1.29], [122, 1.04], [234, 1.04], [69, 0.82], [262, 0.78], [464, 0.76], [211, 0.71], [1, 0.63], [168, 0.62], [67, 0.59], [108, 0.58], [164, 0.57], [57, 0.53], [876, 0.5], [22, 0.48], [960, 0.48], [8, 0.47], [80, 0.47], [757, 0.44], [29, 0.42], [24, 0.41], [426, 0.39], [150, 0.36], [149, 0.35], [175, 0.34], [56, 0.33], [146, 0.33], [698, 0.33], [440, 0.31], [45, 0.3], [9, 0.28], [347, 0.28], [341, 0.26], [490, 0.26], [350, 0.25], [20, 0.24], [1160, 0.24], [151, 0.23], [714, 0.23], [154, 0.22], [643, 0.2], [21, 0.19], [79, 0.18], [264, 0.18], [1038, 0.18], [297, 0.17], [506, 0.17], [23, 0.16], [99, 0.16], [184, 0.16], [353, 0.16], [435, 0.16], [51, 0.15], [125, 0.15], [224, 0.15], [540, 0.15], [729, 0.15], [864, 0.15], [27, 0.14], [35, 0.14], [363, 0.14], [637, 0.14], [34, 0.13], [55, 0.13], [357, 0.13], [860, 0.13], [963, 0.13], [1002, 0.13], [13, 0.12], [84, 0.12], [110, 0.12], [133, 0.12], [984, 0.12], [1215, 0.12], [14, 0.11], [62, 0.11], [195, 0.11], [246, 0.11], [529, 0.11], [851, 0.11], [1039, 0.11], [1127, 0.11], [46, 0.1], [63, 0.1], [71, 0.1], [88, 0.1], [92, 0.1], [804, 0.1], [816, 0.1], [1174, 0.1], [1198, 0.1], [3, 0.09], [26, 0.09], [118, 0.09], [268, 0.09], [338, 0.09], [609, 0.09], [37, 0.08], [53, 0.08], [65, 0.08], [171, 0.08], [197, 0.08], [356, 0.08], [629, 0.08], [845, 0.08], [1319, 0.08], [73, 0.07], [77, 0.07], [82, 0.07], [85, 0.07], [193, 0.07], [226, 0.07], [334, 0.07], [429, 0.07], [469, 0.07], [828, 0.07], [925, 0.07], [962, 0.07], [1411, 0.07], [0, 0.06], [59, 0.06], [96, 0.06], [113, 0.06], [166, 0.06], [220, 0.06], [339, 0.06], [1161, 0.06], [4, 0.05], [25, 0.05], [91, 0.05], [176, 0.05], [252, 0.05], [342, 0.05], [368, 0.05], [385, 0.05], [398, 0.05], [592, 0.05], [822, 0.05], [934, 0.05], [40, 0.04], [74, 0.04], [94, 0.04], [95, 0.04], [117, 0.04], [129, 0.04], [173, 0.04], [194, 0.04], [204, 0.04], [219, 0.04], [273, 0.04], [280, 0.04], [322, 0.04], [399, 0.04], [450, 0.04], [686, 0.04], [691, 0.04], [700, 0.04], [1005, 0.04], [1578, 0.04], [52, 0.03], [75, 0.03], [103, 0.03], [111, 0.03], [167, 0.03], [182, 0.03], [199, 0.03], [244, 0.03], [270, 0.03], [395, 0.03], [430, 0.03], [441, 0.03], [451, 0.03], [580, 0.03], [1210, 0.03], [1227, 0.03], [15, 0.02], [33, 0.02], [47, 0.02], [70, 0.02], [112, 0.02], [143, 0.02], [202, 0.02], [235, 0.02], [237, 0.02], [258, 0.02], [266, 0.02], [282, 0.02], [284, 0.02], [292, 0.02], [305, 0.02], [310, 0.02], [415, 0.02], [453, 0.02], [515, 0.02], [541, 0.02], [579, 0.02], [605, 0.02], [608, 0.02], [612, 0.02], [690, 0.02], [793, 0.02], [852, 0.02], [907, 0.02], [1012, 0.02], [1028, 0.02], [1030, 0.02], [1059, 0.02], [1076, 0.02], [1134, 0.02], [1220, 0.02], [1281, 0.02], [10, 0.01], [11, 0.01], [19, 0.01], [28, 0.01], [49, 0.01], [76, 0.01], [81, 0.01], [86, 0.01], [87, 0.01], [102, 0.01], [116, 0.01], [121, 0.01], [135, 0.01], [139, 0.01], [157, 0.01], [170, 0.01], [181, 0.01], [185, 0.01], [188, 0.01], [191, 0.01], [221, 0.01], [242, 0.01], [251, 0.01], [267, 0.01], [296, 0.01], [300, 0.01], [304, 0.01], [307, 0.01], [314, 0.01], [352, 0.01], [424, 0.01], [437, 0.01], [446, 0.01], [449, 0.01], [494, 0.01], [535, 0.01], [539, 0.01], [610, 0.01], [614, 0.01], [627, 0.01], [636, 0.01], [669, 0.01], [678, 0.01], [681, 0.01], [705, 0.01], [795, 0.01], [830, 0.01], [904, 0.01], [946, 0.01], [994, 0.01], [1007, 0.01], [1025, 0.01], [1033, 0.01], [1041, 0.01], [1049, 0.01], [1066, 0.01], [1072, 0.01], [1085, 0.01], [1086, 0.01], [1126, 0.01], [1140, 0.01], [1141, 0.01], [1176, 0.01], [1199, 0.01], [1201, 0.01], [1208, 0.01], [1260, 0.01], [1279, 0.01], [1295, 0.01], [1299, 0.01], [1320, 0.01], [1364, 0.01], [1431, 0.01], [1454, 0.01], [1756, 0.01], [1767, 0.01]]
real 98m0.896s
user 95m59.027s
sys 0m16.435s
len(self.globalOutOfBagEstimates): 341
numCorrect 315
forrestErrorRate: 0.0762463343109
calcForrestVariableImportance()
globalVariableRanks: [[147, 3.76], [217, 2.31], [148, 2.17], [2, 1.78], [211, 1.42], [152, 1.18], [234, 1.02], [43, 0.79], [168, 0.73], [57, 0.71], [464, 0.68], [56, 0.6], [426, 0.52], [108, 0.51], [149, 0.51], [6, 0.49], [262, 0.49], [440, 0.49], [22, 0.47], [122, 0.47], [27, 0.45], [1, 0.44], [347, 0.43], [164, 0.41], [150, 0.4], [341, 0.4], [21, 0.36], [29, 0.35], [184, 0.34], [960, 0.34], [110, 0.32], [280, 0.32], [490, 0.31], [20, 0.29], [67, 0.29], [529, 0.29], [1160, 0.29], [24, 0.28], [175, 0.28], [506, 0.28], [34, 0.27], [154, 0.27], [8, 0.26], [146, 0.25], [757, 0.21], [1038, 0.21], [69, 0.2], [125, 0.2], [353, 0.2], [363, 0.2], [435, 0.2], [876, 0.2], [224, 0.19], [399, 0.19], [9, 0.18], [357, 0.18], [637, 0.17], [350, 0.16], [804, 0.16], [860, 0.16], [963, 0.16], [45, 0.15], [334, 0.15], [984, 0.14], [1198, 0.14], [3, 0.13], [30, 0.13], [63, 0.13], [698, 0.13], [729, 0.13], [1161, 0.13], [59, 0.12], [338, 0.12], [96, 0.11], [99, 0.11], [246, 0.11], [385, 0.11], [643, 0.11], [864, 0.11], [1127, 0.11], [14, 0.1], [51, 0.1], [133, 0.1], [166, 0.1], [197, 0.1], [204, 0.1], [71, 0.09], [91, 0.09], [185, 0.09], [686, 0.09], [46, 0.08], [53, 0.08], [92, 0.08], [95, 0.08], [107, 0.08], [714, 0.08], [962, 0.08], [33, 0.07], [105, 0.07], [151, 0.07], [195, 0.07], [220, 0.07], [252, 0.07], [297, 0.07], [300, 0.07], [700, 0.07], [830, 0.07], [1215, 0.07], [1411, 0.07], [25, 0.06], [28, 0.06], [47, 0.06], [73, 0.06], [113, 0.06], [219, 0.06], [362, 0.06], [398, 0.06], [1174, 0.06], [23, 0.05], [66, 0.05], [77, 0.05], [94, 0.05], [129, 0.05], [245, 0.05], [267, 0.05], [307, 0.05], [352, 0.05], [429, 0.05], [571, 0.05], [691, 0.05], [816, 0.05], [925, 0.05], [934, 0.05], [11, 0.04], [35, 0.04], [38, 0.04], [84, 0.04], [136, 0.04], [194, 0.04], [241, 0.04], [270, 0.04], [405, 0.04], [415, 0.04], [528, 0.04], [612, 0.04], [795, 0.04], [851, 0.04], [1076, 0.04], [1319, 0.04], [75, 0.03], [78, 0.03], [85, 0.03], [90, 0.03], [111, 0.03], [115, 0.03], [187, 0.03], [192, 0.03], [216, 0.03], [227, 0.03], [242, 0.03], [248, 0.03], [253, 0.03], [304, 0.03], [339, 0.03], [356, 0.03], [441, 0.03], [489, 0.03], [540, 0.03], [629, 0.03], [640, 0.03], [828, 0.03], [844, 0.03], [845, 0.03], [904, 0.03], [1260, 0.03], [40, 0.02], [60, 0.02], [82, 0.02], [88, 0.02], [117, 0.02], [118, 0.02], [134, 0.02], [138, 0.02], [188, 0.02], [199, 0.02], [205, 0.02], [208, 0.02], [251, 0.02], [258, 0.02], [264, 0.02], [273, 0.02], [364, 0.02], [450, 0.02], [539, 0.02], [606, 0.02], [610, 0.02], [634, 0.02], [669, 0.02], [827, 0.02], [852, 0.02], [1002, 0.02], [1039, 0.02], [1140, 0.02], [1208, 0.02], [1254, 0.02], [1767, 0.02], [15, 0.01], [18, 0.01], [19, 0.01], [26, 0.01], [42, 0.01], [54, 0.01], [55, 0.01], [58, 0.01], [68, 0.01], [76, 0.01], [87, 0.01], [89, 0.01], [97, 0.01], [131, 0.01], [143, 0.01], [156, 0.01], [157, 0.01], [159, 0.01], [170, 0.01], [171, 0.01], [176, 0.01], [196, 0.01], [206, 0.01], [222, 0.01], [228, 0.01], [243, 0.01], [244, 0.01], [277, 0.01], [284, 0.01], [292, 0.01], [299, 0.01], [335, 0.01], [342, 0.01], [345, 0.01], [366, 0.01], [368, 0.01], [377, 0.01], [382, 0.01], [390, 0.01], [423, 0.01], [425, 0.01], [427, 0.01], [430, 0.01], [446, 0.01], [449, 0.01], [452, 0.01], [462, 0.01], [532, 0.01], [535, 0.01], [583, 0.01], [602, 0.01], [605, 0.01], [607, 0.01], [609, 0.01], [611, 0.01], [627, 0.01], [652, 0.01], [701, 0.01], [752, 0.01], [753, 0.01], [760, 0.01], [793, 0.01], [840, 0.01], [875, 0.01], [884, 0.01], [891, 0.01], [900, 0.01], [968, 0.01], [976, 0.01], [993, 0.01], [996, 0.01], [1012, 0.01], [1040, 0.01], [1041, 0.01], [1044, 0.01], [1059, 0.01], [1082, 0.01], [1092, 0.01], [1097, 0.01], [1120, 0.01], [1132, 0.01], [1146, 0.01], [1163, 0.01], [1199, 0.01], [1201, 0.01], [1210, 0.01], [1227, 0.01], [1228, 0.01], [1266, 0.01], [1295, 0.01], [1296, 0.01], [1322, 0.01], [1364, 0.01], [1520, 0.01], [1578, 0.01], [1607, 0.01]]
real 96m24.606s
user 95m23.821s
sys 0m13.919s
@kdiverson Notice that we've got 5-7% error rate which is impressive (this is equal to the previous Info Gain measure that we used earlier). But the problem is elsewhere. If you looks closely into the feature ranks, although some of the features are always in the top, but their ordering is different each time. This is quite alarming. Possible reasons:
As @kdiverson has pointed out the outpatient case might be an example of http://en.wikipedia.org/wiki/Law_of_large_numbers. We just need to create enough trees to get the expected average and the current number of trees is too much small.
@darthxaher I can do a run with a large number of trees on our server. Is this the latest code? https://github.com/darthxaher/mothur/blob/unstable/rrf-fs-prototype/pyrrf.py
@kdiverson Yeah, this is the code. I'm running one right now in my other laptop with Datasets/outin.final.an.0.03.subsample.avg.matrix
data. with these parameters
# running with 3000 trees
randomForest = RandomForest(dataSet, 3000, treeSplitCriterion='gainRatio')
It has been 24hr+ and the algo has not completed yet, currently it's occupying 500mb of memory. I suggest you run the code with at least 5000 trees as we have 4350 OTU in this dataset.
Finally Run 3 completed for Datasets/outin.final.an.0.03.subsample.avg.matrix
. With 3000 trees, it took 3012 minutes (50 hrs), roughly one tree per minute. The result is as follows:
len(self.globalOutOfBagEstimates): 341
numCorrect 318
forrestErrorRate: 0.0674486803519
calcForrestVariableImportance()
globalVariableRanks: [[147, 2.3743333333333334], [217, 2.0243333333333333], [234, 1.5933333333333333], [2, 1.5856666666666666], [148, 1.3853333333333333], [152, 1.3523333333333334], [43, 1.2463333333333333], [211, 1.038], [6, 0.8046666666666666], [122, 0.7876666666666666], [168, 0.7846666666666666], [464, 0.7026666666666667], [22, 0.671], [56, 0.6643333333333333], [57, 0.633], [164, 0.551], [69, 0.486], [146, 0.47733333333333333], [29, 0.4703333333333333], [108, 0.4646666666666667], [24, 0.4573333333333333], [175, 0.452], [1, 0.44533333333333336], [347, 0.439], [960, 0.43166666666666664], [149, 0.3863333333333333], [67, 0.37633333333333335], [1038, 0.333], [757, 0.3293333333333333], [154, 0.31766666666666665], [20, 0.305], [426, 0.30466666666666664], [80, 0.30266666666666664], [876, 0.29233333333333333], [341, 0.2783333333333333], [1160, 0.2783333333333333], [280, 0.2733333333333333], [262, 0.273], [440, 0.2693333333333333], [8, 0.26266666666666666], [21, 0.252], [27, 0.252], [150, 0.24766666666666667], [184, 0.24633333333333332], [490, 0.246], [984, 0.24533333333333332], [151, 0.244], [350, 0.222], [34, 0.219], [9, 0.21833333333333332], [714, 0.21233333333333335], [698, 0.212], [435, 0.20166666666666666], [506, 0.19666666666666666], [353, 0.19633333333333333], [224, 0.19466666666666665], [334, 0.189], [246, 0.185], [99, 0.179], [609, 0.156], [45, 0.15566666666666668], [529, 0.15333333333333332], [110, 0.14966666666666667], [385, 0.14933333333333335], [637, 0.14766666666666667], [96, 0.14433333333333334], [363, 0.141], [643, 0.141], [3, 0.13866666666666666], [62, 0.13666666666666666], [804, 0.13566666666666666], [297, 0.13], [1174, 0.12966666666666668], [864, 0.115], [51, 0.11266666666666666], [1161, 0.11166666666666666], [338, 0.11], [197, 0.10966666666666666], [59, 0.107], [133, 0.10433333333333333], [11, 0.104], [125, 0.104], [166, 0.09666666666666666], [1127, 0.09633333333333334], [53, 0.09433333333333334], [63, 0.09333333333333334], [729, 0.09333333333333334], [82, 0.09], [356, 0.08933333333333333], [934, 0.08833333333333333], [339, 0.088], [14, 0.08466666666666667], [25, 0.08], [195, 0.07766666666666666], [399, 0.07466666666666667], [30, 0.07233333333333333], [629, 0.07], [963, 0.069], [962, 0.06633333333333333], [1198, 0.06533333333333333], [118, 0.06466666666666666], [185, 0.06366666666666666], [540, 0.06233333333333333], [429, 0.062], [860, 0.062], [845, 0.060333333333333336], [264, 0.058666666666666666], [194, 0.058], [1076, 0.057666666666666665], [252, 0.056666666666666664], [296, 0.05533333333333333], [700, 0.055], [26, 0.05433333333333333], [71, 0.05433333333333333], [247, 0.05266666666666667], [65, 0.052333333333333336], [816, 0.050666666666666665], [85, 0.049666666666666665], [79, 0.04933333333333333], [84, 0.04933333333333333], [35, 0.048666666666666664], [220, 0.04833333333333333], [226, 0.04833333333333333], [579, 0.04633333333333333], [23, 0.046], [28, 0.046], [75, 0.04533333333333334], [300, 0.043333333333333335], [1208, 0.043333333333333335], [357, 0.043], [92, 0.042], [450, 0.04066666666666666], [1002, 0.04033333333333333], [78, 0.03966666666666667], [138, 0.03966666666666667], [305, 0.03866666666666667], [235, 0.038], [627, 0.037333333333333336], [248, 0.03666666666666667], [38, 0.035666666666666666], [690, 0.035333333333333335], [88, 0.034666666666666665], [95, 0.033666666666666664], [395, 0.033666666666666664], [925, 0.033666666666666664], [851, 0.03333333333333333], [73, 0.03266666666666666], [90, 0.03266666666666666], [268, 0.032], [10, 0.030666666666666665], [94, 0.030666666666666665], [691, 0.030666666666666665], [342, 0.030333333333333334], [219, 0.029666666666666668], [830, 0.029666666666666668], [1319, 0.029666666666666668], [606, 0.029], [204, 0.028666666666666667], [828, 0.028333333333333332], [1215, 0.027333333333333334], [241, 0.026333333333333334], [113, 0.026], [40, 0.025333333333333333], [74, 0.025333333333333333], [441, 0.025333333333333333], [580, 0.025333333333333333], [244, 0.025], [844, 0.024666666666666667], [105, 0.024333333333333332], [284, 0.024333333333333332], [4, 0.024], [362, 0.023666666666666666], [1039, 0.023666666666666666], [1134, 0.023666666666666666], [1041, 0.023333333333333334], [55, 0.023], [112, 0.023], [640, 0.022], [61, 0.021666666666666667], [669, 0.021666666666666667], [1028, 0.021666666666666667], [282, 0.02], [1260, 0.02], [111, 0.019666666666666666], [236, 0.019666666666666666], [634, 0.019666666666666666], [156, 0.019333333333333334], [469, 0.019333333333333334], [1033, 0.019333333333333334], [795, 0.019], [994, 0.019], [77, 0.018666666666666668], [37, 0.018], [171, 0.018], [1059, 0.018], [1146, 0.018], [759, 0.017333333333333333], [46, 0.017], [187, 0.017], [107, 0.016666666666666666], [307, 0.016666666666666666], [530, 0.016666666666666666], [615, 0.016666666666666666], [304, 0.01633333333333333], [72, 0.016], [68, 0.015333333333333332], [176, 0.015333333333333332], [398, 0.014666666666666666], [685, 0.014666666666666666], [1005, 0.014666666666666666], [1578, 0.014666666666666666], [36, 0.014333333333333333], [129, 0.014333333333333333], [884, 0.014333333333333333], [227, 0.014], [630, 0.014], [904, 0.014], [449, 0.013333333333333334], [968, 0.013333333333333334], [1097, 0.013333333333333334], [1130, 0.013333333333333334], [572, 0.013], [1320, 0.013], [322, 0.012333333333333333], [346, 0.012333333333333333], [686, 0.012333333333333333], [900, 0.012333333333333333], [310, 0.012], [489, 0.012], [1227, 0.012], [822, 0.011666666666666667], [1012, 0.011666666666666667], [352, 0.011333333333333334], [103, 0.011], [270, 0.011], [314, 0.011], [31, 0.010666666666666666], [50, 0.010333333333333333], [242, 0.010333333333333333], [76, 0.01], [162, 0.009666666666666667], [494, 0.009666666666666667], [1030, 0.009666666666666667], [1411, 0.009666666666666667], [988, 0.009333333333333334], [1086, 0.009333333333333334], [462, 0.009], [1120, 0.009], [13, 0.008666666666666666], [193, 0.008666666666666666], [382, 0.008666666666666666], [842, 0.008666666666666666], [868, 0.008666666666666666], [966, 0.008666666666666666], [1057, 0.008666666666666666], [58, 0.008333333333333333], [202, 0.008333333333333333], [1176, 0.008333333333333333], [117, 0.008], [167, 0.008], [256, 0.008], [376, 0.008], [1364, 0.008], [54, 0.007666666666666666], [875, 0.007666666666666666], [1141, 0.007666666666666666], [60, 0.007333333333333333], [97, 0.007333333333333333], [196, 0.007333333333333333], [617, 0.007333333333333333], [701, 0.007333333333333333], [827, 0.007333333333333333], [892, 0.007333333333333333], [267, 0.007], [344, 0.007], [704, 0.007], [1210, 0.007], [1454, 0.007], [222, 0.006666666666666667], [614, 0.006666666666666667], [1284, 0.006666666666666667], [206, 0.006333333333333333], [605, 0.006333333333333333], [705, 0.006333333333333333], [188, 0.006], [592, 0.006], [49, 0.005666666666666667], [163, 0.005666666666666667], [277, 0.005666666666666667], [299, 0.005666666666666667], [583, 0.005666666666666667], [623, 0.005666666666666667], [1767, 0.005666666666666667], [427, 0.005333333333333333], [602, 0.005333333333333333], [993, 0.005333333333333333], [1049, 0.005333333333333333], [221, 0.005], [228, 0.005], [451, 0.005], [454, 0.005], [610, 0.005], [611, 0.005], [766, 0.005], [793, 0.005], [976, 0.005], [1025, 0.005], [1068, 0.005], [1082, 0.005], [260, 0.004666666666666667], [444, 0.004666666666666667], [453, 0.004666666666666667], [81, 0.004333333333333333], [109, 0.004333333333333333], [173, 0.004333333333333333], [364, 0.004333333333333333], [1072, 0.004333333333333333], [1173, 0.004333333333333333], [1295, 0.004333333333333333], [251, 0.004], [415, 0.004], [521, 0.004], [612, 0.004], [737, 0.004], [1085, 0.004], [1629, 0.004], [0, 0.0036666666666666666], [19, 0.0036666666666666666], [160, 0.0036666666666666666], [405, 0.0036666666666666666], [511, 0.0036666666666666666], [537, 0.0036666666666666666], [636, 0.0036666666666666666], [839, 0.0036666666666666666], [969, 0.0036666666666666666], [1026, 0.0036666666666666666], [1220, 0.0036666666666666666], [18, 0.0033333333333333335], [191, 0.0033333333333333335], [258, 0.0033333333333333335], [1055, 0.0033333333333333335], [1211, 0.0033333333333333335], [1228, 0.0033333333333333335], [131, 0.003], [203, 0.003], [335, 0.003], [368, 0.003], [645, 0.003], [681, 0.003], [682, 0.003], [740, 0.003], [850, 0.003], [1044, 0.003], [1132, 0.003], [1163, 0.003], [1540, 0.003], [1554, 0.003], [15, 0.0026666666666666666], [159, 0.0026666666666666666], [192, 0.0026666666666666666], [198, 0.0026666666666666666], [273, 0.0026666666666666666], [281, 0.0026666666666666666], [289, 0.0026666666666666666], [526, 0.0026666666666666666], [549, 0.0026666666666666666], [840, 0.0026666666666666666], [1007, 0.0026666666666666666], [1066, 0.0026666666666666666], [1384, 0.0026666666666666666], [1663, 0.0026666666666666666], [86, 0.0023333333333333335], [240, 0.0023333333333333335], [452, 0.0023333333333333335], [852, 0.0023333333333333335], [1053, 0.0023333333333333335], [1156, 0.0023333333333333335], [1216, 0.0023333333333333335], [1254, 0.0023333333333333335], [1274, 0.0023333333333333335], [1300, 0.0023333333333333335], [104, 0.002], [199, 0.002], [292, 0.002], [354, 0.002], [366, 0.002], [470, 0.002], [527, 0.002], [1004, 0.002], [1064, 0.002], [1116, 0.002], [1204, 0.002], [1212, 0.002], [1296, 0.002], [1322, 0.002], [1381, 0.002], [116, 0.0016666666666666668], [218, 0.0016666666666666668], [243, 0.0016666666666666668], [325, 0.0016666666666666668], [351, 0.0016666666666666668], [414, 0.0016666666666666668], [458, 0.0016666666666666668], [515, 0.0016666666666666668], [569, 0.0016666666666666668], [577, 0.0016666666666666668], [581, 0.0016666666666666668], [693, 0.0016666666666666668], [753, 0.0016666666666666668], [758, 0.0016666666666666668], [762, 0.0016666666666666668], [965, 0.0016666666666666668], [1089, 0.0016666666666666668], [1192, 0.0016666666666666668], [1292, 0.0016666666666666668], [1626, 0.0016666666666666668], [309, 0.0013333333333333333], [424, 0.0013333333333333333], [430, 0.0013333333333333333], [518, 0.0013333333333333333], [532, 0.0013333333333333333], [534, 0.0013333333333333333], [571, 0.0013333333333333333], [603, 0.0013333333333333333], [651, 0.0013333333333333333], [676, 0.0013333333333333333], [891, 0.0013333333333333333], [907, 0.0013333333333333333], [1060, 0.0013333333333333333], [1126, 0.0013333333333333333], [1136, 0.0013333333333333333], [1137, 0.0013333333333333333], [1140, 0.0013333333333333333], [1201, 0.0013333333333333333], [1279, 0.0013333333333333333], [1280, 0.0013333333333333333], [1283, 0.0013333333333333333], [1286, 0.0013333333333333333], [1456, 0.0013333333333333333], [1468, 0.0013333333333333333], [1756, 0.0013333333333333333], [66, 0.001], [121, 0.001], [123, 0.001], [180, 0.001], [261, 0.001], [326, 0.001], [378, 0.001], [386, 0.001], [397, 0.001], [493, 0.001], [586, 0.001], [689, 0.001], [986, 0.001], [1092, 0.001], [1094, 0.001], [1101, 0.001], [1107, 0.001], [1177, 0.001], [1185, 0.001], [1199, 0.001], [1223, 0.001], [1285, 0.001], [1288, 0.001], [1431, 0.001], [1438, 0.001], [1574, 0.001], [33, 0.0006666666666666666], [87, 0.0006666666666666666], [100, 0.0006666666666666666], [106, 0.0006666666666666666], [126, 0.0006666666666666666], [158, 0.0006666666666666666], [288, 0.0006666666666666666], [321, 0.0006666666666666666], [546, 0.0006666666666666666], [607, 0.0006666666666666666], [638, 0.0006666666666666666], [655, 0.0006666666666666666], [657, 0.0006666666666666666], [684, 0.0006666666666666666], [707, 0.0006666666666666666], [773, 0.0006666666666666666], [950, 0.0006666666666666666], [1040, 0.0006666666666666666], [1153, 0.0006666666666666666], [1262, 0.0006666666666666666], [1270, 0.0006666666666666666], [1332, 0.0006666666666666666], [1414, 0.0006666666666666666], [1492, 0.0006666666666666666], [1520, 0.0006666666666666666], [1607, 0.0006666666666666666], [1682, 0.0006666666666666666], [16, 0.0003333333333333333], [157, 0.0003333333333333333], [161, 0.0003333333333333333], [205, 0.0003333333333333333], [238, 0.0003333333333333333], [301, 0.0003333333333333333], [303, 0.0003333333333333333], [337, 0.0003333333333333333], [465, 0.0003333333333333333], [497, 0.0003333333333333333], [501, 0.0003333333333333333], [502, 0.0003333333333333333], [539, 0.0003333333333333333], [565, 0.0003333333333333333], [631, 0.0003333333333333333], [653, 0.0003333333333333333], [679, 0.0003333333333333333], [694, 0.0003333333333333333], [695, 0.0003333333333333333], [706, 0.0003333333333333333], [711, 0.0003333333333333333], [719, 0.0003333333333333333], [770, 0.0003333333333333333], [781, 0.0003333333333333333], [817, 0.0003333333333333333], [873, 0.0003333333333333333], [886, 0.0003333333333333333], [913, 0.0003333333333333333], [946, 0.0003333333333333333], [996, 0.0003333333333333333], [1001, 0.0003333333333333333], [1027, 0.0003333333333333333], [1067, 0.0003333333333333333], [1119, 0.0003333333333333333], [1217, 0.0003333333333333333], [1241, 0.0003333333333333333], [1266, 0.0003333333333333333], [1277, 0.0003333333333333333], [1281, 0.0003333333333333333], [1293, 0.0003333333333333333], [1466, 0.0003333333333333333], [1528, 0.0003333333333333333]]
real 3012m0.782s
user 2979m6.048s
sys 6m15.653s
@kdiverson I'd try do another 3000 tree run and see what comes out :)
@darthxaher I did a run with 5000 trees on our server.
resources_used.cput=10:04:10
resources_used.mem=747060kb
resources_used.vmem=974832kb
resources_used.walltime=10:04:16
calcForrestErrorRate()
len(self.globalOutOfBagEstimates): 187
numCorrect 137
forrestErrorRate: 0.267379679144
calcForrestVariableImportance()
globalVariableRanks: [[9, 4.3906], [2, 0.7462], [264, 0.2266], [182, 0.1638], [14, 0.1576], [43, 0.1562], [33, 0.1474], [31, 0.1316], [11, 0.1266], [7, 0.121], [16, 0.1154], [41, 0.1124], [36, 0.1066], [145, 0.1058], [86, 0.0924], [27, 0.091], [32, 0.0896], [140, 0.0892], [34, 0.0876], [151, 0.0816], [129, 0.0812], [158, 0.0774], [161, 0.0726], [88, 0.0632], [112, 0.0612], [26, 0.0606], [100, 0.0578], [73, 0.0574], [141, 0.056], [114, 0.0558], [39, 0.0556], [47, 0.054], [91, 0.0518], [157, 0.0512], [60, 0.0504], [133, 0.0498], [302, 0.0498], [228, 0.0486], [105, 0.0482], [84, 0.0474], [68, 0.0462], [58, 0.0448], [37, 0.0436], [25, 0.0416], [127, 0.039], [144, 0.0388], [12, 0.0382], [57, 0.0376], [64, 0.0364], [72, 0.0362], [22, 0.0346], [24, 0.0344], [285, 0.0316], [77, 0.028], [184, 0.028], [254, 0.0274], [468, 0.027], [74, 0.0254], [117, 0.0252], [51, 0.0244], [148, 0.0244], [390, 0.0244], [414, 0.0244], [234, 0.0242], [82, 0.0236], [98, 0.023], [119, 0.023], [49, 0.0218], [159, 0.0218], [61, 0.0214], [85, 0.0206], [568, 0.0206], [17, 0.0204], [256, 0.0202], [71, 0.0192], [42, 0.019], [296, 0.0186], [70, 0.018], [21, 0.0164], [80, 0.0164], [286, 0.0164], [40, 0.0154], [52, 0.0154], [125, 0.0154], [230, 0.0152], [69, 0.015], [371, 0.0148], [572, 0.0144], [13, 0.0142], [405, 0.0138], [204, 0.0134], [280, 0.0134], [23, 0.0126], [155, 0.0126], [176, 0.012], [267, 0.012], [532, 0.012], [554, 0.012], [187, 0.0118], [338, 0.0118], [677, 0.0116], [142, 0.0114], [156, 0.0114], [243, 0.0114], [79, 0.0112], [195, 0.0112], [255, 0.0112], [643, 0.0106], [737, 0.0106], [258, 0.0102], [220, 0.0098], [456, 0.0098], [427, 0.0096], [90, 0.0094], [304, 0.0094], [673, 0.0094], [212, 0.0092], [154, 0.0088], [642, 0.0086], [78, 0.0084], [231, 0.0082], [334, 0.008], [435, 0.008], [224, 0.0076], [65, 0.0074], [346, 0.0074], [379, 0.0074], [314, 0.007], [562, 0.007], [636, 0.007], [458, 0.0068], [276, 0.0066], [406, 0.0066], [785, 0.0064], [421, 0.0062], [44, 0.006], [339, 0.0056], [259, 0.0054], [308, 0.0054], [196, 0.0052], [279, 0.0052], [327, 0.0052], [494, 0.0052], [679, 0.0052], [409, 0.005], [260, 0.0048], [412, 0.0048], [630, 0.0048], [702, 0.0048], [116, 0.0046], [10, 0.0044], [89, 0.0042], [128, 0.0042], [347, 0.0042], [467, 0.0042], [638, 0.0042], [297, 0.004], [357, 0.004], [639, 0.004], [54, 0.0038], [389, 0.0036], [569, 0.0036], [623, 0.0036], [728, 0.0036], [381, 0.0034], [615, 0.0034], [118, 0.0032], [268, 0.003], [313, 0.0026], [325, 0.0026], [365, 0.0026], [416, 0.0026], [621, 0.0026], [633, 0.0026], [432, 0.0024], [682, 0.0024], [213, 0.0022], [320, 0.0022], [387, 0.0022], [83, 0.002], [261, 0.002], [287, 0.002], [326, 0.002], [188, 0.0018], [400, 0.0018], [99, 0.0016], [407, 0.0014], [578, 0.0014], [191, 0.0012], [420, 0.0012], [518, 0.001], [152, 0.0008], [250, 0.0006], [586, 0.0004], [93, 0.0002], [281, 0.0002]]
@kdiverson The output looks a bit strange. which dataset did you use? inpatient.final.an.0.03.subsample.avg.matrix
or outin.final.an.0.03.subsample.avg.matrix
. If the dataset was inpatient.final.an.0.03.subsample.avg.matrix
then the output is fine for that.
I'm interested in outin.final.an.0.03.subsample.avg.matrix
dataset at this point. Check this line:
# fileReaderFactory = FileReaderFactory(fileType = 'matrix', matrixFilePath = 'Datasets/inpatient.final.an.0.03.subsample.avg.matrix');
fileReaderFactory = FileReaderFactory(fileType = 'matrix', matrixFilePath = 'Datasets/outin.final.an.0.03.subsample.avg.matrix');
Make changes to the code like this and we can run analysis for the outpatient
data as well.
@darthxaher yeah, it was the inpatient data. Running again now with the outin dataset.
@darthxaher can you check the speed of your rrf code against the R version? As long as we get the C++ code around the same speed we should be fine.
the outin dataset:
resources_used.cput=63:06:49
resources_used.mem=1000696kb
resources_used.vmem=1228380kb
resources_used.walltime=63:07:14
calcForrestErrorRate()
len(self.globalOutOfBagEstimates): 341
numCorrect 321
forrestErrorRate: 0.058651026393
calcForrestVariableImportance()
globalVariableRanks: [[147, 2.171], [217, 1.9656], [2, 1.8314], [234, 1.5374], [152, 1.4008], [43, 1.3202], [148, 1.3084], [211, 1.0522], [464, 0.8364], [56, 0.7784], [6, 0.7736], [168, 0.75], [122, 0.6474], [69, 0.6394], [22, 0.6012], [57, 0.5902], [164, 0.5624], [24, 0.4704], [29, 0.4636], [175, 0.4596], [146, 0.4584], [108, 0.4448], [960, 0.4322], [1, 0.4284], [67, 0.4112], [149, 0.4048], [20, 0.366], [347, 0.3572], [80, 0.3514], [262, 0.3258], [426, 0.3198], [440, 0.3128], [27, 0.312], [1038, 0.3074], [350, 0.2942], [280, 0.2864], [876, 0.28], [1160, 0.2792], [184, 0.2706], [341, 0.2706], [154, 0.2664], [490, 0.2654], [757, 0.2616], [8, 0.2606], [984, 0.2564], [21, 0.2424], [150, 0.2258], [353, 0.2126], [435, 0.2072], [698, 0.2046], [151, 0.2008], [34, 0.1956], [334, 0.1836], [9, 0.1824], [506, 0.1776], [45, 0.174], [224, 0.1722], [643, 0.17], [246, 0.1688], [804, 0.1688], [714, 0.1678], [529, 0.1666], [637, 0.1602], [609, 0.1556], [62, 0.15], [363, 0.1392], [385, 0.1392], [99, 0.1352], [96, 0.1348], [3, 0.1232], [51, 0.1218], [110, 0.1212], [125, 0.1208], [1174, 0.1184], [25, 0.1142], [133, 0.1122], [729, 0.1118], [339, 0.1104], [864, 0.1104], [59, 0.1032], [197, 0.101], [1161, 0.095], [338, 0.0942], [934, 0.0942], [14, 0.093], [297, 0.0912], [629, 0.0882], [11, 0.088], [195, 0.0876], [399, 0.0876], [1127, 0.087], [963, 0.0864], [356, 0.0844], [82, 0.0816], [63, 0.0808], [71, 0.0786], [53, 0.0778], [166, 0.073], [30, 0.0674], [860, 0.0664], [845, 0.0658], [296, 0.0656], [252, 0.0626], [118, 0.0624], [185, 0.0614], [540, 0.0608], [194, 0.0604], [700, 0.0596], [1076, 0.059], [85, 0.0584], [962, 0.0582], [28, 0.0564], [65, 0.0512], [357, 0.0512], [1198, 0.0512], [264, 0.0508], [429, 0.0504], [84, 0.05], [23, 0.0492], [247, 0.0492], [75, 0.0486], [79, 0.0484], [92, 0.047], [579, 0.0466], [816, 0.0456], [1208, 0.0456], [1002, 0.0454], [851, 0.0444], [226, 0.0432], [78, 0.0422], [26, 0.0418], [300, 0.0414], [204, 0.0398], [220, 0.0376], [925, 0.0374], [95, 0.0366], [342, 0.0366], [55, 0.0356], [113, 0.0356], [1215, 0.0352], [35, 0.034], [219, 0.0338], [156, 0.0328], [830, 0.0328], [31, 0.0302], [105, 0.0302], [138, 0.0298], [235, 0.0298], [244, 0.0298], [90, 0.0294], [40, 0.029], [305, 0.0286], [49, 0.0284], [441, 0.0284], [94, 0.0282], [606, 0.028], [248, 0.0276], [627, 0.0276], [38, 0.0274], [73, 0.0274], [1319, 0.0272], [10, 0.025], [241, 0.025], [395, 0.025], [450, 0.025], [844, 0.0242], [61, 0.0238], [828, 0.0238], [88, 0.0236], [1041, 0.0236], [268, 0.0234], [759, 0.0232], [691, 0.023], [68, 0.0228], [1039, 0.022], [187, 0.0216], [580, 0.0216], [193, 0.0214], [690, 0.021], [530, 0.0206], [572, 0.0202], [236, 0.0196], [1028, 0.0194], [1134, 0.0194], [4, 0.0192], [70, 0.019], [129, 0.0188], [282, 0.0188], [634, 0.0188], [1146, 0.0186], [284, 0.0182], [13, 0.0178], [111, 0.0176], [1033, 0.0176], [640, 0.0174], [77, 0.017], [112, 0.0166], [304, 0.0166], [669, 0.0166], [1005, 0.0166], [171, 0.016], [1059, 0.016], [46, 0.0156], [196, 0.0156], [1578, 0.0154], [74, 0.0148], [352, 0.0148], [72, 0.0144], [307, 0.0144], [617, 0.0142], [686, 0.0142], [103, 0.014], [1411, 0.0138], [167, 0.0134], [1260, 0.0134], [1320, 0.0132], [162, 0.013], [176, 0.013], [685, 0.0128], [904, 0.0128], [1030, 0.0128], [310, 0.0126], [994, 0.0126], [54, 0.0124], [615, 0.0124], [33, 0.0122], [346, 0.012], [453, 0.012], [270, 0.0116], [58, 0.0114], [192, 0.0114], [256, 0.0114], [37, 0.0112], [766, 0.011], [258, 0.0108], [449, 0.0108], [884, 0.0108], [107, 0.0106], [630, 0.0106], [968, 0.0106], [1057, 0.0106], [36, 0.0104], [60, 0.0102], [188, 0.01], [1012, 0.0098], [1097, 0.0098], [469, 0.0096], [494, 0.0096], [1130, 0.0096], [81, 0.0092], [322, 0.0092], [267, 0.009], [822, 0.009], [314, 0.0088], [368, 0.0086], [827, 0.0084], [701, 0.0082], [842, 0.0082], [1140, 0.0082], [1141, 0.0082], [1210, 0.0082], [222, 0.008], [451, 0.008], [1086, 0.008], [97, 0.0078], [376, 0.0078], [405, 0.0078], [206, 0.0076], [1227, 0.0076], [0, 0.0074], [299, 0.0074], [398, 0.0074], [795, 0.0074], [462, 0.0072], [1120, 0.0072], [592, 0.007], [605, 0.0068], [1176, 0.0068], [66, 0.0064], [227, 0.0064], [198, 0.0062], [301, 0.0062], [444, 0.0062], [427, 0.006], [202, 0.0058], [362, 0.0058], [900, 0.0058], [966, 0.0058], [988, 0.0058], [1300, 0.0058], [1364, 0.0058], [199, 0.0054], [277, 0.0054], [875, 0.0054], [1284, 0.0054], [1454, 0.0054], [1767, 0.0054], [868, 0.0052], [976, 0.0052], [454, 0.005], [489, 0.005], [511, 0.005], [1025, 0.005], [177, 0.0048], [1085, 0.0048], [15, 0.0046], [19, 0.0046], [611, 0.0046], [705, 0.0046], [1163, 0.0046], [1216, 0.0046], [1629, 0.0046], [251, 0.0044], [583, 0.0044], [1001, 0.0044], [136, 0.0042], [242, 0.0042], [271, 0.0042], [281, 0.0042], [850, 0.0042], [1101, 0.0042], [1285, 0.0042], [993, 0.004], [1554, 0.004], [521, 0.0038], [946, 0.0038], [1044, 0.0038], [614, 0.0036], [793, 0.0036], [109, 0.0034], [182, 0.0034], [382, 0.0034], [1072, 0.0034], [414, 0.0032], [892, 0.0032], [1173, 0.0032], [1540, 0.0032], [1626, 0.0032], [191, 0.003], [260, 0.003], [1220, 0.003], [1262, 0.003], [1295, 0.003], [1574, 0.003], [104, 0.0028], [119, 0.0028], [160, 0.0028], [366, 0.0028], [377, 0.0028], [493, 0.0028], [526, 0.0028], [645, 0.0028], [740, 0.0028], [1053, 0.0028], [1055, 0.0028], [1066, 0.0028], [1068, 0.0028], [1204, 0.0028], [1211, 0.0028], [1254, 0.0028], [1520, 0.0028], [18, 0.0026], [139, 0.0026], [163, 0.0026], [737, 0.0026], [1007, 0.0026], [1082, 0.0026], [1092, 0.0026], [1607, 0.0026], [203, 0.0024], [243, 0.0024], [415, 0.0024], [502, 0.0024], [527, 0.0024], [652, 0.0024], [753, 0.0024], [969, 0.0024], [1199, 0.0024], [1286, 0.0024], [228, 0.0022], [518, 0.0022], [132, 0.002], [216, 0.002], [327, 0.002], [344, 0.002], [452, 0.002], [470, 0.002], [688, 0.002], [762, 0.002], [891, 0.002], [1089, 0.002], [1126, 0.002], [83, 0.0018], [123, 0.0018], [292, 0.0018], [309, 0.0018], [684, 0.0018], [689, 0.0018], [873, 0.0018], [1004, 0.0018], [1132, 0.0018], [1384, 0.0018], [50, 0.0016], [86, 0.0016], [117, 0.0016], [571, 0.0016], [1107, 0.0016], [1292, 0.0016], [116, 0.0014], [158, 0.0014], [221, 0.0014], [237, 0.0014], [537, 0.0014], [569, 0.0014], [602, 0.0014], [612, 0.0014], [626, 0.0014], [631, 0.0014], [681, 0.0014], [708, 0.0014], [1137, 0.0014], [1274, 0.0014], [1663, 0.0014], [159, 0.0012], [178, 0.0012], [354, 0.0012], [378, 0.0012], [546, 0.0012], [549, 0.0012], [564, 0.0012], [577, 0.0012], [657, 0.0012], [839, 0.0012], [990, 0.0012], [996, 0.0012], [1094, 0.0012], [1116, 0.0012], [1192, 0.0012], [1202, 0.0012], [1296, 0.0012], [1322, 0.0012], [218, 0.001], [374, 0.001], [458, 0.001], [507, 0.001], [610, 0.001], [622, 0.001], [707, 0.001], [1026, 0.001], [1060, 0.001], [1064, 0.001], [1087, 0.001], [1156, 0.001], [1270, 0.001], [1332, 0.001], [1381, 0.001], [1414, 0.001], [1478, 0.001], [131, 0.0008], [261, 0.0008], [326, 0.0008], [335, 0.0008], [351, 0.0008], [397, 0.0008], [421, 0.0008], [515, 0.0008], [668, 0.0008], [682, 0.0008], [693, 0.0008], [695, 0.0008], [711, 0.0008], [781, 0.0008], [965, 0.0008], [1049, 0.0008], [1136, 0.0008], [1223, 0.0008], [1283, 0.0008], [1468, 0.0008], [1756, 0.0008], [41, 0.0006], [106, 0.0006], [205, 0.0006], [321, 0.0006], [325, 0.0006], [430, 0.0006], [639, 0.0006], [840, 0.0006], [852, 0.0006], [1040, 0.0006], [1067, 0.0006], [1153, 0.0006], [1165, 0.0006], [1177, 0.0006], [1212, 0.0006], [1241, 0.0006], [1317, 0.0006], [1438, 0.0006], [1441, 0.0006], [1456, 0.0006], [1657, 0.0006], [144, 0.0004], [165, 0.0004], [257, 0.0004], [337, 0.0004], [365, 0.0004], [438, 0.0004], [607, 0.0004], [636, 0.0004], [713, 0.0004], [728, 0.0004], [758, 0.0004], [780, 0.0004], [899, 0.0004], [913, 0.0004], [1119, 0.0004], [1185, 0.0004], [1200, 0.0004], [1201, 0.0004], [1205, 0.0004], [1228, 0.0004], [1280, 0.0004], [1288, 0.0004], [1398, 0.0004], [1465, 0.0004], [1593, 0.0004], [1682, 0.0004], [16, 0.0002], [87, 0.0002], [161, 0.0002], [180, 0.0002], [465, 0.0002], [501, 0.0002], [503, 0.0002], [528, 0.0002], [534, 0.0002], [586, 0.0002], [623, 0.0002], [628, 0.0002], [653, 0.0002], [655, 0.0002], [658, 0.0002], [676, 0.0002], [679, 0.0002], [694, 0.0002], [715, 0.0002], [986, 0.0002], [1027, 0.0002], [1122, 0.0002], [1240, 0.0002], [1248, 0.0002], [1266, 0.0002], [1279, 0.0002], [1293, 0.0002], [1401, 0.0002], [1402, 0.0002], [1418, 0.0002], [1431, 0.0002], [1492, 0.0002]]
In our Random Forest implementation we have implemented information gain using entropy as the internal measure, but from the literature, it's evident that Information Gain Ratio would be a better measure. Investigate further into this issue and if needed, implement this replacing the old code.