@@ -78,7 +78,11 @@ namespace Timbl {
7878 IBtree ( const IBtree& ) = delete ; // forbid copies
7979 IBtree& operator =( const IBtree& ) = delete ; // forbid copies
8080 ~IBtree ();
81- IBtree *Reduce ( const TargetValue *, unsigned long &, long );
81+ IBtree *Reduce ( const TargetValue *,
82+ unsigned long &,
83+ long ,
84+ bool ,
85+ ClassDistribution*& );
8286#ifdef IBSTATS
8387 static inline IBtree *add_feat_val ( FeatureValue *,
8488 unsigned int &,
@@ -119,7 +123,6 @@ namespace Timbl {
119123 InstanceBase_base ( size_t , unsigned long &, bool , bool );
120124 virtual ~InstanceBase_base ( void ) override ;
121125 void AssignDefaults ( void );
122- void RedoDistributions ();
123126 bool AddInstance ( const Instance& );
124127 void RemoveInstance ( const Instance& );
125128 void summarizeNodes ( std::vector<unsigned int >&,
@@ -164,8 +167,8 @@ namespace Timbl {
164167 Feature_List&,
165168 Targets&,
166169 int );
167- virtual void Prune ( const TargetValue *, long = 0 );
168- virtual bool IsPruned () const { return false ; };
170+ virtual void Prune ( const TargetValue *, bool = false , long = 0 );
171+ bool IsPruned () const { return Pruned ; };
169172 void CleanPartition ( bool );
170173 unsigned long int GetSizeInfo ( unsigned long int &, double & ) const ;
171174 const ClassDistribution *TopDist () const { return TopDistribution; };
@@ -184,6 +187,7 @@ namespace Timbl {
184187 bool DefaultsValid;
185188 bool Random;
186189 bool PersistentDistributions;
190+ bool Pruned;
187191 int Version;
188192 ClassDistribution *TopDistribution;
189193 WClassDistribution *WTop;
@@ -231,14 +235,17 @@ namespace Timbl {
231235
232236 class IB_InstanceBase : public InstanceBase_base {
233237 public:
234- IB_InstanceBase ( size_t size, unsigned long & cnt, bool rand ):
235- InstanceBase_base ( size, cnt, rand , false ),
238+ IB_InstanceBase ( size_t size,
239+ unsigned long & cnt,
240+ bool rand ):
241+ InstanceBase_base ( size, cnt, rand , false ),
236242 offSet (0 ),
237243 effFeat (0 ),
238244 testInst (0 )
239245 {};
240246 IB_InstanceBase *Copy () const override ;
241247 IB_InstanceBase *clone () const override ;
248+ void Prune ( const TargetValue *, bool =false , long = 0 ) override ;
242249 const ClassDistribution *InitGraphTest ( std::vector<FeatureValue *>&,
243250 const std::vector<FeatureValue *> *,
244251 const size_t ,
@@ -255,12 +262,11 @@ namespace Timbl {
255262 public:
256263 IG_InstanceBase ( size_t size, unsigned long & cnt,
257264 bool rand, bool pruned, bool keep_dists ):
258- InstanceBase_base ( size, cnt, rand, keep_dists ), Pruned( pruned ) { };
265+ InstanceBase_base ( size, cnt, rand, keep_dists ) { Pruned = pruned; };
259266 IG_InstanceBase *clone () const override ;
260267 IG_InstanceBase *Copy () const override ;
261- void Prune ( const TargetValue *, long = 0 ) override ;
268+ void Prune ( const TargetValue *, bool = false , long = 0 ) override ;
262269 void specialPrune ( const TargetValue * );
263- bool IsPruned () const override { return Pruned; };
264270 const ClassDistribution *IG_test ( const Instance& ,
265271 size_t &,
266272 bool &,
@@ -274,8 +280,6 @@ namespace Timbl {
274280 Targets&,
275281 int ) override ;
276282 bool MergeSub ( InstanceBase_base * ) override ;
277- protected:
278- bool Pruned;
279283 };
280284
281285 class TRIBL_InstanceBase : public InstanceBase_base {
0 commit comments