Skip to content
Snippets Groups Projects
Commit e2c4d536 authored by aastorg2's avatar aastorg2
Browse files

changing learner to choose halfway point bet negative and positive for threshold

parent 0f47f5c0
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#define DEBUG true
#include "defns.i" #include "defns.i"
#include "extern.i" #include "extern.i"
...@@ -92,7 +93,7 @@ int main(int Argc, char *Argv[]) ...@@ -92,7 +93,7 @@ int main(int Argc, char *Argv[])
FILE *F; FILE *F;
CaseNo SaveMaxCase; CaseNo SaveMaxCase;
Attribute Att; Attribute Att;
// Pranav: // Pranav:
// struct rlimit RL; // struct rlimit RL;
...@@ -112,7 +113,7 @@ int main(int Argc, char *Argv[]) ...@@ -112,7 +113,7 @@ int main(int Argc, char *Argv[])
*/ */
/* Check for output to be saved to a file */ /* Check for output to be saved to a file */
if ( Argc > 2 && ! strcmp(Argv[Argc-2], "-o") ) if ( Argc > 2 && ! strcmp(Argv[Argc-2], "-o") )
{ {
Of = fopen(Argv[Argc-1], "w"); Of = fopen(Argv[Argc-1], "w");
......
...@@ -192,7 +192,7 @@ void ConstructClassifiers() ...@@ -192,7 +192,7 @@ void ConstructClassifiers()
// Pranav: Turn off pruning // Pranav: Turn off pruning
//Prune(Pruned[Trial]); //Prune(Pruned[Trial]);
AdjustAllThresholds(Pruned[Trial]); //AdjustAllThresholds(Pruned[Trial]);
/* Record tree parameters for later */ /* Record tree parameters for later */
......
...@@ -194,7 +194,7 @@ void EvalContinuousAtt(Attribute Att, CaseNo Fp, CaseNo Lp) ...@@ -194,7 +194,7 @@ void EvalContinuousAtt(Attribute Att, CaseNo Fp, CaseNo Lp)
{ {
Bar[Att] = GEnv.LowVal; Bar[Att] = GEnv.LowVal;
} }
Verbosity(2, Verbosity(2,
fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n", fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n",
AttName[Att], Bar[Att], Info[Att], Gain[Att])) AttName[Att], Bar[Att], Info[Att], Gain[Att]))
...@@ -367,7 +367,7 @@ void EvalContinuousAttAlg1(Attribute Att, CaseNo Fp, CaseNo Lp) ...@@ -367,7 +367,7 @@ void EvalContinuousAttAlg1(Attribute Att, CaseNo Fp, CaseNo Lp)
{ {
Bar[Att] = GEnv.LowVal; Bar[Att] = GEnv.LowVal;
} }
Verbosity(2, Verbosity(2,
fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n", fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n",
AttName[Att], Bar[Att], Info[Att], Gain[Att])) AttName[Att], Bar[Att], Info[Att], Gain[Att]))
...@@ -540,7 +540,7 @@ void EvalContinuousAttAlg2(Attribute Att, CaseNo Fp, CaseNo Lp) ...@@ -540,7 +540,7 @@ void EvalContinuousAttAlg2(Attribute Att, CaseNo Fp, CaseNo Lp)
{ {
Bar[Att] = GEnv.LowVal; Bar[Att] = GEnv.LowVal;
} }
Verbosity(2, Verbosity(2,
fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f, penalty %.3f\n", fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f, penalty %.3f\n",
AttName[Att], Bar[Att], Info[Att], Gain[Att], penalty)) AttName[Att], Bar[Att], Info[Att], Gain[Att], penalty))
...@@ -912,6 +912,10 @@ void EvalContinuousAttAlg3(Attribute Att, CaseNo Fp, CaseNo Lp) ...@@ -912,6 +912,10 @@ void EvalContinuousAttAlg3(Attribute Att, CaseNo Fp, CaseNo Lp)
Bar[Att] = GEnv.LowVal; Bar[Att] = GEnv.LowVal;
} }
printf("angello1\n");
printf( "angello Bar: %3f\n",Bar[Att]);
printf( "angello HighVal\n: %3f",GEnv.HighVal);
printf( "angello\n: %3f",GEnv.LowVal);
Verbosity(2, Verbosity(2,
fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n", fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n",
AttName[Att], Bar[Att], Info[Att], Gain[Att])) AttName[Att], Bar[Att], Info[Att], Gain[Att]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment