original_string: protected function runConjugateGradient(array $samples, array $targets, Closure $gradientFunc): void
      {
          if ($this->optimizer === null) {
              $this->optimizer = (new ConjugateGradient($this->featureCount))
                  ->setMaxIterations($this->maxIterations);
          }
  
          $this->weights = $this->optimizer->runOptimization($samples, $targets, $gradientFunc);
          $this->costValues = $this->optimizer->getCostValues();
      }
code: protected function runConjugateGradient(array $samples, array $targets, Closure $gradientFunc): void
      {
          if ($this->optimizer === null) {
              $this->optimizer = (new ConjugateGradient($this->featureCount))
                  ->setMaxIterations($this->maxIterations);
          }
  
          $this->weights = $this->optimizer->runOptimization($samples, $targets, $gradientFunc);
          $this->costValues = $this->optimizer->getCostValues();
      }
code_tokens: protected function runConjugateGradient ( array $ samples , array $ targets , Closure $ gradientFunc ) : void { if ( $ this -> optimizer === null ) { $ this -> optimizer = ( new ConjugateGradient ( $ this -> featureCount ) ) -> setMaxIterations ( $ this -> maxIterations ) ; } $ this -> weights = $ this -> optimizer -> runOptimization ( $ samples , $ targets , $ gradientFunc ) ; $ this -> costValues = $ this -> optimizer -> getCostValues ( ) ; }
docstring: Executes Conjugate Gradient method to optimize the weights of the LogReg model
docstring_tokens: Executes Conjugate Gradient method to optimize the weights of the LogReg model