### Question:
SparseBinaryToNetwork { protected void computeFactors() { pf = new double[numFeatures]; nf = new double[numFeatures]; ppf = new double[numFeatures]; pnf = new double[numFeatures]; nnf = new double[numFeatures]; for (int i=0; i<numFeatures; i++) { double mean = (1.0 * numNonZerosPerFeature[i]) / numGenes; if (mean == 0) { continue; } pf[i] = -Math.log(mean); nf[i] = Math.log(1-mean); ppf[i] = pf[i]*pf[i]; pnf[i] = pf[i]*nf[i]; nnf[i] = nf[i]*nf[i]; } } SparseBinaryToNetwork(int numGenes, int numFeatures); void convert(List<int[]> profileData, int k); Matrix convertToInteractionMatrix(); int dump(PrintWriter writer, String[] geneNames);  }### Answer:
@Test public void testComputeFactors() { int numFeatures = 10; int [] g1 = {2,4}; int [] g2 = {3,4,9}; int [] g3 = {}; Vector<int[]> profileData = new Vector<int[]>(); profileData.add(g1); profileData.add(g2); profileData.add(g3); int numGenes = profileData.size(); SparseBinaryToNetwork p2n = new SparseBinaryToNetwork(numGenes, numFeatures); p2n.countNonZerosPerFeature(profileData); p2n.computeFactors(); assertNotNull(p2n.nnf); assertNotNull(p2n.pnf); assertNotNull(p2n.ppf); }