protected override string CreateReportLine( ModelScorer modelScorer, PhyloTree phyloTree, RowData rowAndTargetData, UniversalWorkList workList, int rowIndex, int workListCount, int workIndex) { Dictionary <string, string> row = rowAndTargetData.Row; string predictorVariable = row[PhyloTree.PredictorVariableColumnName]; // e.g. hla string targetVariable = row[PhyloTree.TargetVariableColumnName]; // e.g. A@182 (amino acid "A" at position 182) int nullIndex = int.Parse(row[PhyloTree.NullIndexColumnName]); //Dictionary<string, bool> caseIdToNonMissingPredictorValue = workList.NullIndexToPredictorToCaseIdToNonMissingValue[nullIndex][predictorVariable]; Dictionary <string, SufficientStatistics> caseIdToNonMissingPredictorValue = rowAndTargetData.PredictorData; //workList.GetCaseIdToNonMissingValueForNullIndexAndPredictorVariable(nullIndex, predictorVariable); Dictionary <string, SufficientStatistics> caseIdToNonMissingTargetValue = rowAndTargetData.TargetData; TwoByTwo fishers2by2 = TwoByTwo.GetInstance( SufficientStatisticsMapToIntMap(caseIdToNonMissingPredictorValue), SufficientStatisticsMapToIntMap(caseIdToNonMissingTargetValue)); double pValue = fishers2by2.FisherExactTest; string reportLine = SpecialFunctions.CreateTabString(this, rowIndex, workListCount, workIndex, nullIndex, predictorVariable, targetVariable, fishers2by2.CountsString(), fishers2by2.FisherExactTest); return(reportLine); }
public static EvaluationResultsFisher GetInstance(ModelEvaluatorDiscreteFisher modelEvaluatorDiscreteFisher, List <Score> nullScores, Score altScore, TwoByTwo fishers2by2) { double pValue = fishers2by2.FisherExactTest; int[] fisherCounts = fishers2by2.ToOneDArray(); return(new EvaluationResultsFisher(modelEvaluatorDiscreteFisher, nullScores, altScore, fisherCounts, 1, pValue)); }
static void Main(string[] args) { var input = System.IO.File.ReadAllLines(@"C:\Users\shashi.dadi\Desktop\Advent of code\Day21.txt"); var twoByTwoPatterns = new TwoByTwo(); var threeByThreePatterns = new ThreeByThree(); }