From e2c4d5364b85097f05dbb81f18c81584b3bf981e Mon Sep 17 00:00:00 2001
From: Angello Astorga <aastorg2@illinois.edu>
Date: Wed, 21 Sep 2022 18:48:23 -0400
Subject: [PATCH] changing learner to choose halfway point bet negative and
 positive for threshold

---
 c50exact/c50.c       |  5 +++--
 c50exact/construct.c |  2 +-
 c50exact/contin.c    | 10 +++++++---
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/c50exact/c50.c b/c50exact/c50.c
index 55485e4..d68423e 100644
--- a/c50exact/c50.c
+++ b/c50exact/c50.c
@@ -30,6 +30,7 @@
 /*									 */
 /*************************************************************************/
 
+#define DEBUG true
 
 #include "defns.i"
 #include "extern.i"
@@ -92,7 +93,7 @@ int main(int Argc, char *Argv[])
     FILE		*F;
     CaseNo		SaveMaxCase;
     Attribute		Att;
-
+	
     // Pranav:
     // struct rlimit RL;
 
@@ -112,7 +113,7 @@ int main(int Argc, char *Argv[])
     */
 
     /*  Check for output to be saved to a file  */
-
+	
     if ( Argc > 2 && ! strcmp(Argv[Argc-2], "-o") )
     {
 	Of = fopen(Argv[Argc-1], "w");
diff --git a/c50exact/construct.c b/c50exact/construct.c
index eb7cd25..dcb5425 100644
--- a/c50exact/construct.c
+++ b/c50exact/construct.c
@@ -192,7 +192,7 @@ void ConstructClassifiers()
 	// Pranav: Turn off pruning
 	//Prune(Pruned[Trial]);
 
-	AdjustAllThresholds(Pruned[Trial]);
+	//AdjustAllThresholds(Pruned[Trial]);
 
 	/*  Record tree parameters for later  */
 
diff --git a/c50exact/contin.c b/c50exact/contin.c
index 54628ee..5b96a61 100644
--- a/c50exact/contin.c
+++ b/c50exact/contin.c
@@ -194,7 +194,7 @@ void EvalContinuousAtt(Attribute Att, CaseNo Fp, CaseNo Lp)
 	{
 	    Bar[Att] = GEnv.LowVal;
 	}
-
+	
 	Verbosity(2,
 	    fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n",
 		   AttName[Att], Bar[Att], Info[Att], Gain[Att]))
@@ -367,7 +367,7 @@ void EvalContinuousAttAlg1(Attribute Att, CaseNo Fp, CaseNo Lp)
     {
         Bar[Att] = GEnv.LowVal;
     }
-
+	
     Verbosity(2,
         fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n",
     	   AttName[Att], Bar[Att], Info[Att], Gain[Att]))
@@ -540,7 +540,7 @@ void EvalContinuousAttAlg2(Attribute Att, CaseNo Fp, CaseNo Lp)
     {
         Bar[Att] = GEnv.LowVal;
     }
-
+	
     Verbosity(2,
         fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f, penalty %.3f\n",
     	   AttName[Att], Bar[Att], Info[Att], Gain[Att], penalty))
@@ -912,6 +912,10 @@ void EvalContinuousAttAlg3(Attribute Att, CaseNo Fp, CaseNo Lp)
         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,
         fprintf(Of, "\tAtt %s\tcut=%.3f, inf %.3f, gain %.3f\n",
     	   AttName[Att], Bar[Att], Info[Att], Gain[Att]))
-- 
GitLab