public function train(FeatureFactoryInterface $ff, TrainingSet $tset, MaxentOptimizerInterface $opt)
    {
        $classSet = $tset->getClassSet();

        $features = $this->calculateFeatureArray($classSet,$tset,$ff);
        $this->l = $opt->optimize($features);
    }
public function train(FeatureFactoryInterface $ff, TrainingSet $tset, MaxentOptimizerInterface $opt)
    {
        $classSet = $tset->getClassSet();

        $features = $this->calculateFeatureArray($classSet,$tset,$ff);
        $this->l = $opt->optimize($features);
    }
public function train ( FeatureFactoryInterface $ ff , TrainingSet $ tset , MaxentOptimizerInterface $ opt ) { $ classSet = $ tset -> getClassSet ( ) ; $ features = $ this -> calculateFeatureArray ( $ classSet , $ tset , $ ff ) ; $ this -> l = $ opt -> optimize ( $ features ) ; }
Calculate all the features for every possible class. Pass the
information to the optimizer to find the weights that satisfy the
constraints and maximize the entropy

@param $ff The feature factory
@param $tset A collection of training documents
@param $opt An optimizer, we need a maxent optimizer
@return void
Calculate all the features for every possible class . Pass the information to the optimizer to find the weights that satisfy the constraints and maximize the entropy