This will return an array including an importance value for
each column in the given dataset. The importance values are
normalized and their total makes 1.<br/>

@return array
182868
public function getFeatureImportances()
    {
        if ($this->featureImportances !== null) {
            return $this->featureImportances;
        }

        $sampleCount = count($this->samples);
        $this->featureImportances = [];
        foreach ($this->columnNames as $column => $columnName) {
            $nodes = $this->getSplitNodesByColumn($column, $this->tree);

            $importance = 0;
            foreach ($nodes as $node) {
                $importance += $node->getNodeImpurityDecrease($sampleCount);
            }

            $this->featureImportances[$columnName] = $importance;
        }

        // Normalize & sort the importances
        $total = array_sum($this->featureImportances);
        if ($total > 0) {
            foreach ($this->featureImportances as &$importance) {
                $importance /= $total;
            }
            arsort($this->featureImportances);
        }

        return $this->featureImportances;
    }
1248294
protected function getColumns()
    {
        $availableColumns = array_map('strtolower', $this->headers);

        if ($this->option('compact')) {
            return array_intersect($availableColumns, $this->compactColumns);
        }

        if ($columns = $this->option('columns')) {
            return array_intersect($availableColumns, $columns);
        }

        return $availableColumns;
    }
891644
public function toArray()
    {
        $arrRet = [];
        foreach ($this as $propName => $propValue) {
            if ($this->hasColumn($propName)) {
                $arrRet[$propName] = $propValue;
            }
        }

        return $arrRet;
    }
250310
public function getPrimaryValues(array $data) : array
    {
        $return = [];
        /** @var Column $column */
        foreach ($this->thead->elements as $column) {
            if ($column instanceof Column && $column->isPrimary()) {
                $return[$column->getId()] = $data[$column->getId()] ?? null;
            }
        }

        return $return;
    }
390800
protected function getColumns()
    {
        if (array_key_exists('columns', $this->searchable)) {
            $driver = $this->getDatabaseDriver();
            $prefix = Config::get("database.connections.$driver.prefix");
            $columns = [];
            foreach($this->searchable['columns'] as $column => $priority){
                $columns[$prefix . $column] = $priority;
            }
            return $columns;
        } else {
            return DB::connection()->getSchemaBuilder()->getColumnListing($this->table);
        }
    }
952709
public function proba(Dataset $dataset) : array
    {
        if (empty($this->samples) or empty($this->labels)) {
            throw new RuntimeException('The learner has not'
                . ' been trained.');
        }

        DatasetIsCompatibleWithEstimator::check($dataset, $this);

        $template = array_fill_keys($this->classes, 0.);

        $probabilities = [];

        foreach ($dataset as $sample) {
            [$labels, $distances] = $this->nearest($sample);

            if ($this->weighted) {
                $weights = array_fill_keys($labels, 0.);

                foreach ($labels as $i => $label) {
                    $weights[$label] += 1. / (1. + $distances[$i]);
                }
            } else {
                $weights = array_count_values($labels);
            }

            $total = array_sum($weights) ?: EPSILON;

            $dist = $template;

            foreach ($weights as $class => $weight) {
                $dist[$class] = $weight / $total;
            }

            $probabilities[] = $dist;
        }

        return $probabilities;
    }
1061337
public function getColumnArray() {
        $fields = array('name','type','passThrough','default','nullable',
                        'index','unique','after','pkey');
        $fields = array_flip($fields);
        foreach($fields as $key => &$val)
            $val = $this->{$key};
        unset($val);
        return $fields;
    }
1046020
protected function columnsToDisplay()
    {
        if (!$this->input->hasOption('columns')) {
            return [];
        }
        $columns = $this->input->getOption('columns');
        if (count($columns) === 1) {
            $columns = preg_split('/\s*,\s*/', $columns[0]);
        }

        return $columns;
    }
727809
function data(): array
    {
        $this->putRetainedFilterValuesInSession();

        $this->buildWidgetsData(
            DashboardQueryParams::create()
                ->fillWithRequest()
                ->setDefaultFilters($this->getFilterDefaultValues())
        );

        // First, graph widgets dataSets
        $data = collect($this->graphWidgetDataSets)
            ->map(function(array $dataSets, string $key) {
                $dataSetsValues = collect($dataSets)->map->toArray();

                return [
                    "key" => $key,
                    "datasets" => $dataSetsValues->map(function($dataSet) {
                        return array_except($dataSet, "labels");
                    })->all(),
                    "labels" => $dataSetsValues->first()["labels"]
                ];
            });

        // Then, panel widgets data
        return $data->merge(
            collect($this->panelWidgetsData)->map(function($value, $key) {
                return [
                    "key" => $key,
                    "data" => $value
                ];
            })
        )->all();
    }
1217596
public function rank(Dataset $dataset) : array
    {
        if (!$this->r or !$this->histograms) {
            throw new RuntimeException('The learner has not'
                . ' been trained.');
        }

        DatasetIsCompatibleWithEstimator::check($dataset, $this);

        $z = Matrix::quick($dataset->samples())
            ->matmul($this->r)
            ->transpose();

        return $this->logLikelihood($z);
    }
796063
public function getParams()
    {
        $params = [];
        $dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName());

        foreach ($this->getMap() as $criterion) {

            $table = null;
            foreach ($criterion->getAttachedCriterion() as $attachedCriterion) {
                $tableName = $attachedCriterion->getTable();

                $table = $this->getTableForAlias($tableName);
                if (null === $table) {
                    $table = $tableName;
                }

                if (
                    ($this->isIgnoreCase() || method_exists($attachedCriterion, 'setIgnoreCase'))
                    && $dbMap->getTable($table)->getColumn($attachedCriterion->getColumn())->isText()
                ) {
                    $attachedCriterion->setIgnoreCase(true);
                }
            }

            $sb = '';
            $criterion->appendPsTo($sb, $params);
        }

        $having = $this->getHaving();
        if (null !== $having) {
            $sb = '';
            $having->appendPsTo($sb, $params);
        }

        return $params;
    }
1173084
public function getDirtyColumns()
    {
        $ret = array_keys($this->_cleanData);
        foreach ($this->_getSiblingRows() as $r) {
            $ret = array_merge($ret, $r->getDirtyColumns());
        }
        return $ret;
    }
1302181
public function getValues()
    {
        $values = array();
        foreach ($this->rows as $name => $row) {
            $values[$name] = $row->getValue();
        }

        return $values;
    }
1102194
public function getIncludedColumn()
    {
        $model  = $this->config->getDataModel();
        $nested = $this->getOption('nested');
        $fk     = $nested['models'][0]->{$nested['pieces'][0]}()->getForeignKey();

        return array($fk => $model->getTable().'.'.$fk);
    }
889781
public function getValuesAsArray() {
		$values = [];
		foreach($this->getValues() as $value) {
			$values[$value->getId()] = $value->getName();
		}

		return $values;
	}
500545
public function proba(Dataset $dataset) : array
    {
        if (!$this->network or !$this->classes) {
            throw new RuntimeException('The learner has not'
                . ' been trained.');
        }

        DatasetIsCompatibleWithEstimator::check($dataset, $this);

        $xT = Matrix::quick($dataset->samples())->transpose();

        $yT = $this->network->infer($xT)->transpose();

        $probabilities = [];

        foreach ($yT as $activations) {
            $probabilities[] = array_combine($this->classes, $activations);
        }

        return $probabilities;
    }
376476
public function getDimensionValues()
    {
        $values = [];
        
        foreach ($this->fields as $dim => $field) {
            $values[$dim] = is_numeric($field->dataValue()) ? (int) $field->dataValue() : null;
        }
        
        return $values;
    }