Changeset 117
- Timestamp:
- Jan 13, 2010, 8:05:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
proiecte/Parallel-DT/R8/Src/discr.c
r103 r117 61 61 /* Special case when no known values of the attribute */ 62 62 63 //printf("nr threads executing: %d\n", omp_get_num_threads()); 64 63 65 if (Items <= ValFreq_discr[0]) { 64 66 Verbosity(2) 65 67 printf("\tAtt %s: no known values\n", AttName[Att]); 66 68 67 *the_gain = -Epsilon; 68 *the_info = 0.0; 69 //*the_gain = -Epsilon; 70 Gain[Att] = -Epsilon; 71 //*the_info = 0.0; 72 Info[Att] = 0.0; 69 73 return; 70 74 } 71 75 72 *the_gain = ComputeGain_Discr(DiscrKnownBaseInfo_Discr(KnownItems, MaxAttVal[Att], Freq_discr), 73 UnknownRate_discr[Att], MaxAttVal[Att], KnownItems, Freq_discr, ValFreq_discr); 74 *the_info = TotalInfo(ValFreq_discr, 0, MaxAttVal[Att]) / Items; 76 //*the_gain = ComputeGain_Discr(DiscrKnownBaseInfo_Discr(KnownItems, MaxAttVal[Att], Freq_discr), 77 //UnknownRate_discr[Att], MaxAttVal[Att], KnownItems, Freq_discr, ValFreq_discr); 78 Gain[Att] = ComputeGain_Discr(DiscrKnownBaseInfo_Discr(KnownItems, MaxAttVal[Att], Freq_discr), 79 UnknownRate_discr[Att], MaxAttVal[Att], KnownItems, Freq_discr, ValFreq_discr); 80 //*the_info = TotalInfo(ValFreq_discr, 0, MaxAttVal[Att]) / Items; 81 Info[Att] = TotalInfo(ValFreq_discr, 0, MaxAttVal[Att]) / Items; 75 82 76 83 Verbosity(2) { … … 78 85 Verbosity(3) 79 86 PrintDistribution_Discr(Att, MaxAttVal[Att], true, Freq_discr); 80 printf("\tinf %.3f, gain %.3f\n", *the_info, *the_gain); 87 //printf("\tinf %.3f, gain %.3f\n", *the_info, *the_gain); 88 printf("\tinf %.3f, gain %.3f\n", Info[Att], Gain[Att]); 81 89 } 82 90 … … 138 146 ForEach(p, Fp, Lp) { 139 147 Case = Item[p]; 148 140 149 Freq_discr[DVal(Case,Att)][Class(Case)] += Weight[p]; 141 150 }
Note: See TracChangeset
for help on using the changeset viewer.