public function filterByLabel(callable $fn) : self
    {
        $samples = $labels = [];

        foreach ($this->labels as $i => $label) {
            if ($fn($label)) {
                $samples[] = $this->samples[$i];
                $labels[] = $label;
            }
        }

        return self::quick($samples, $labels);
    }
public function filterByLabel(callable $fn) : self
    {
        $samples = $labels = [];

        foreach ($this->labels as $i => $label) {
            if ($fn($label)) {
                $samples[] = $this->samples[$i];
                $labels[] = $label;
            }
        }

        return self::quick($samples, $labels);
    }
public function filterByLabel ( callable $ fn ) : self { $ samples = $ labels = [ ] ; foreach ( $ this -> labels as $ i => $ label ) { if ( $ fn ( $ label ) ) { $ samples [ ] = $ this -> samples [ $ i ] ; $ labels [ ] = $ label ; } } return self :: quick ( $ samples , $ labels ) ; }
Run a filter over the dataset using the labels for Decision.

@param callable $fn
@return self
Run a filter over the dataset using the labels for Decision .