original_string: public function getFeatureImportances(): array
      {
          // Traverse each tree and sum importance of the columns
          $sum = [];
          foreach ($this->classifiers as $tree) {
              /** @var DecisionTree $tree */
              $importances = $tree->getFeatureImportances();
  
              foreach ($importances as $column => $importance) {
                  if (array_key_exists($column, $sum)) {
                      $sum[$column] += $importance;
                  } else {
                      $sum[$column] = $importance;
                  }
              }
          }
  
          // Normalize & sort the importance values
          $total = array_sum($sum);
          array_walk($sum, function (&$importance) use ($total): void {
              $importance /= $total;
          });
          arsort($sum);
  
          return $sum;
      }
code: public function getFeatureImportances(): array
      {
          // Traverse each tree and sum importance of the columns
          $sum = [];
          foreach ($this->classifiers as $tree) {
              /** @var DecisionTree $tree */
              $importances = $tree->getFeatureImportances();
  
              foreach ($importances as $column => $importance) {
                  if (array_key_exists($column, $sum)) {
                      $sum[$column] += $importance;
                  } else {
                      $sum[$column] = $importance;
                  }
              }
          }
  
          // Normalize & sort the importance values
          $total = array_sum($sum);
          array_walk($sum, function (&$importance) use ($total): void {
              $importance /= $total;
          });
          arsort($sum);
  
          return $sum;
      }
code_tokens: public function getFeatureImportances ( ) : array { // Traverse each tree and sum importance of the columns $ sum = [ ] ; foreach ( $ this -> classifiers as $ tree ) { /** @var DecisionTree $tree */ $ importances = $ tree -> getFeatureImportances ( ) ; foreach ( $ importances as $ column => $ importance ) { if ( array_key_exists ( $ column , $ sum ) ) { $ sum [ $ column ] += $ importance ; } else { $ sum [ $ column ] = $ importance ; } } } // Normalize & sort the importance values $ total = array_sum ( $ sum ) ; array_walk ( $ sum , function ( & $ importance ) use ( $ total ) : void { $ importance /= $ total ; } ) ; arsort ( $ sum ) ; return $ sum ; }
docstring: This will return an array including an importance value for
  each column in the given dataset. Importance values for a column
  is the average importance of that column in all trees in the forest
docstring_tokens: This will return an array including an importance value for each column in the given dataset . Importance values for a column is the average importance of that column in all trees in the forest