Returns the probability of the sample of belonging to the given label

Probability of a sample is calculated as the proportion of the label
within the labels of the training samples in the decision node

@param mixed $label
190998
protected function predictProbability(array $sample, $label): float
    {
        $predicted = $this->predictSampleBinary($sample);
        if ((string) $predicted == (string) $label) {
            return $this->prob[$label];
        }

        return 0.0;
    }
1131819
public function addGroup($label = null)
    {
        if (!is_array($label)) {
            $label = ['label' => $label];
        } elseif (isset($label[0])) {
            $label['label'] = $label[0];
            unset($label[0]);
        }

        $label['form'] = $this->form;

        return $this->add(new static($label));
    }
1154897
public function labels($labels = null)
    {
        if ($labels === null)
        {
            return $this->_labels;
        }

        $this->_labels = $labels;
        return $this;
    }
1360176
protected function predictProbability(array $sample, $label): float
    {
        $predicted = $this->predictSampleBinary($sample);

        if ((string) $predicted == (string) $label) {
            $sample = $this->checkNormalizedSample($sample);

            return (float) abs($this->output($sample));
        }

        return 0.0;
    }
317023
private function sampleProbability($sample, $feature, $label)
    {
        $value = $sample[$feature];
        if ($this->dataType[$label][$feature] == self::NOMINAL) {
            if (!isset($this->discreteProb[$label][$feature][$value]) ||
                $this->discreteProb[$label][$feature][$value] == 0) {
                return self::EPSILON;
            }
            return $this->discreteProb[$label][$feature][$value];
        }
        $std = $this->std[$label][$feature] ;
        $mean= $this->mean[$label][$feature];
        // Calculate the probability density by use of normal/Gaussian distribution
        // Ref: https://en.wikipedia.org/wiki/Normal_distribution
        //
        // In order to avoid numerical errors because of small or zero values,
        // some libraries adopt taking log of calculations such as
        // scikit-learn did.
        // (See : https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/naive_bayes.py)
        $pdf  =  -0.5 * log(2.0 * pi() * $std * $std);
        $pdf -= 0.5 * pow($value - $mean, 2) / ($std * $std);
        return $pdf;
    }
114798
public function getButtonLabel($label)
    {
        if ($label instanceof Closure) {
            $label = call_user_func($label, $this);
        } else {
            $label = Yii::t('hipanel', $label, ['count' => count($this->getSpoiledItems())]);
        }

        return $label;
    }
816110
public function getSingleNode($label = null)
    {
        $nodes = (null === $label) ? $this->getNodes() : $this->getNodesByLabel($label);
        $single = current($nodes);

        return $single;
    }
1132922
public function get($label = null)
    {
        if ($label && array_key_exists($label, $this->results)) {
            return $this->results[$label];
        }
        $results = [];
        foreach ($this->results as $v) {
            if (is_array($v)) {
                $results = array_merge($results, $v);
            } else {
                $results[] = $v;
            }
        }

        return $results;
    }
1281416
public function setLabel(LabelElement $label)
    {

        $this->label = $label;

        if(($for = $this->getAttribute('id'))) {
            $label->setAttribute('for', $for);
        }

        return $this;

    }
1122151
public function deleteLabel(\stdClass $label)
    {
        // Prevents to delete a label which has children.
        if ($this->hasChildren($label)) {
            throw new \LogicException("Can't delete a label which has children.");
        }
        return taxonomy_term_delete($label->tid);
    }
178620
public function setLabel( $label ) {
		$this->labelValue = (string)$label !== '' ? $label : null;

		$this->label->clearContent();
		if ( $this->labelValue !== null ) {
			if ( is_string( $this->labelValue ) && trim( $this->labelValue ) === '' ) {
				$this->label->appendContent( new HtmlSnippet( '&nbsp;' ) );
			} else {
				$this->label->appendContent( $label );
			}
		}

		$visibleLabel = $this->labelValue !== null && !$this->invisibleLabel;
		$this->toggleClasses( [ 'oo-ui-labelElement' ], $visibleLabel );

		return $this;
	}
611650
public function setLabel($label)
        {
            if (null !== $label && !is_string($label)) {
                throw new Exception(
                        'Invalid argument: $label must be a string or null');
            }

            $this->_label = $label;
            return $this;
        }
29362
function has($label)
    {
        $r = $this->getIterator()->find( array('label' => strtolower($label)) );
        foreach ($r as $v)
            return true;

        return false;
    }
411832
public function score(array $predictions, array $labels) : float
    {
        if (empty($predictions)) {
            return 0.;
        }

        if (count($predictions) !== count($labels)) {
            throw new InvalidArgumentException('The number of labels'
                . ' must equal the number of predictions.');
        }

        $mean = Stats::mean($labels);

        $ssr = $sst = 0.;

        foreach ($predictions as $i => $prediction) {
            $label = $labels[$i];

            $ssr += ($label - $prediction) ** 2;
            $sst += ($label - $mean) ** 2;
        }

        return 1. - ($ssr / ($sst ?: EPSILON));
    }
59019
protected function _findObject($label)
    {
        $result    = false;
        $signature = null;

        $method = sprintf('_get%sSignature', ucfirst($label));

        if (method_exists($this, $method)) {
            $signature = $this->$method();
        }

        if (is_null($signature) || !isset(self::$_find_results[$signature]))
        {
            $method = '_findActivity' . ucfirst($label);

            if (method_exists($this, $method)) {
                $result = (bool) $this->$method();
            }

            if ($signature) {
                self::$_find_results[$signature] = $result;
            }
        }
        else $result = self::$_find_results[$signature];

        return $result;
    }
487986
public function addLabel($label)
    {
        if (null !== $label) {
            $l = (string) $label;
            if (!$this->hasLabel($l)) {
                $this->labels->add($l);

                return true;
            }
        }

        return false;
    }
1372689
public function label($label=null){
		if($label){
			$this->label = $label;
		}else{
			return isset($this->label) ? $this->label : $this->name();
		}
	}