|
@@ -229,7 +229,7 @@ int FPCRandomForests::classify_optimize(Example & pce)
|
|
|
|
|
|
void FPCRandomForests::train(FeaturePool & fp, Examples & examples)
|
|
|
{
|
|
|
- fprintf (stderr,"FPCRandomForests::train()\n");
|
|
|
+
|
|
|
assert(builder != NULL);
|
|
|
|
|
|
if (maxClassNo < 0)
|
|
@@ -250,9 +250,8 @@ void FPCRandomForests::train(FeaturePool & fp, Examples & examples)
|
|
|
|
|
|
if (weight_examples)
|
|
|
{
|
|
|
- for (Examples::iterator i = examples.begin();
|
|
|
- i != examples.end();
|
|
|
- i++, index++)
|
|
|
+ for ( Examples::iterator i = examples.begin();
|
|
|
+ i != examples.end(); i++, index++ )
|
|
|
i->second.weight = examples.size() / example_distribution[i->first];
|
|
|
}
|
|
|
|
|
@@ -305,7 +304,7 @@ void FPCRandomForests::train(FeaturePool & fp, Examples & examples)
|
|
|
else
|
|
|
trainingExamples = (int)(examples_index.size() * samples_per_tree);
|
|
|
|
|
|
- fprintf (stderr, "FPCRandomForests: selection of %d examples for each tree\n", trainingExamples );
|
|
|
+ fprintf (stderr, "FPCRandomForests: selection of %d examples for each tree (classno: %d)\n", trainingExamples, j->first );
|
|
|
|
|
|
if ( (trainingExamples < 3) && ((int)examples_index.size() > trainingExamples) )
|
|
|
{
|