Set the threshold probability a classifier document must meet
@param  float                     $threshold float value between 0-1
@throws \InvalidArgumentException
483020
public function setThreshold($threshold)
    {
        if (is_numeric($threshold)) {
            $this->threshold = $threshold;
            $this->svm->setOptions(
                array(
                    \SVM::OPT_PROBABILITY => true
                )
            );
            if ($this->model->isPrepared()) {
                $this->model->setPrepared(false);
            }
        } else {
            throw new \InvalidArgumentException("Threshold must be a float value between 0-1");
        }
    }
876898
protected function setAndVerify($value, $interval)
    {
        if (!filter_var($value, FILTER_VALIDATE_INT) && $value != '0') {
            throw new InvalidArgumentException(sprintf("The %s should be an integer.", $interval));
        }
        $this->$interval = $value;
    }
572133
public function setRank($rank)
    {
        if (! is_int($rank)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be an int value. Valued passed is of type ' . gettype($rank));
        }
        
        $this->rank = $rank;
    }
1146066
public function setLowerBound($lowerBound)
    {
        if (is_float($lowerBound) || is_double($lowerBound) || (is_bool($lowerBound) && $lowerBound === false)) {
            $this->lowerBound = $lowerBound;
        } else {
            $msg = "The 'lowerBound' attribute must be a float or false, '" . gettype($lowerBound) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
306145
public function setLevel($level)
    {
        if (!($level >= 0.01 && $level <= 4.99)) {
            throw new \InvalidArgumentException("Gamma Level Must Be In Range(0.01,4.99)");
        }
        $this->level = (float) $level;

        return $this;
    }
790155
public function setMin($min)
    {
        $min = (int) $min;

        if ($min < 0) {
            throw new \InvalidArgumentException('Error: Minimum cannot be smaller than zero');
        }
        if ($min > $this->max) {
            // We do not throw an exception but silently adjust the maximum.
            $this->max = $min;
        }

        $this->min = $min;
    }
1065654
public void setThreshold(final double THRESHOLD) {
        originalThreshold = THRESHOLD;
        if (null == threshold) {
            _threshold = clamp(getMinValue(), getMaxValue(), THRESHOLD);
            fireTileEvent(RESIZE_EVENT);
        } else {
            threshold.set(THRESHOLD);
        }
    }
838963
public static function setReportLevel(string $level): Matcha {
            if( ReportLevel::has($level) === false ) {
                throw new InvalidArgumentException(sprintf('The report level should be one of the following: %s, %s given', 
                    implode(', ', ReportLevel::availables()),
                    $level
                )); 
            }

            static::$reportLevel = $level;
            
            return new static;
        }
1257108
public function setAmount($amount)
    {
      if(!is_int($amount) || $amount < 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid amount, must be a positive integer');

      $this->amount = $amount;
    }
983493
public function setUpperBound($upperBound)
    {
        if (is_float($upperBound) === true) {
            $this->upperBound = $upperBound;
        } else {
            $msg = "The 'upperBound' argument must be a float value, '" . gettype($upperBound) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
767615
protected function setProperties($percentage)
    {
        if ($percentage > 1) {
            throw new \InvalidArgumentException('$percentage must be less than 1');
        }

        $this->sourceImageHeight = $this->sourceImage->getHeight();
        $this->sourceImageWidth = $this->sourceImage->getWidth();

        $this->mergeImageHeight = $this->mergeImage->getHeight();
        $this->mergeImageWidth = $this->mergeImage->getWidth();

        $this->calculateOverlap($percentage);
        $this->calculateCenter();
    }
19456
public function isBinaryBufferEmpty($threshold = 0.01) {
		$bin = $this->getBinaryBuffer();
		// delete all empty bytes
		if(strlen(trim($bin, chr(255))) / strlen($bin) < $threshold || strlen(trim($bin, chr(0))) / strlen($bin) < $threshold) {
			// something is wrong, image is filled (almost) solid color.
			return true;
		}
		return false;
	}
1289740
public function setPriority(int $priority): void
    {
        if ($priority < 0 || $priority > static::MAX_PRIORITY) {
            throw new \InvalidArgumentException('Priority must be an unsigned integer on the range [0-65535]');
        }

        $this->priority = $priority;
    }
762137
public function setRange(int $start, int $end) : void
    {
        if ($end < $start) {
            throw new InvalidArgumentException('End must be greater or equal to start');
        }

        if ($end === $start) {
            return;
        }

        --$end;

        $firstInt = $start >> 5;
        $lastInt = $end >> 5;

        for ($i = $firstInt; $i <= $lastInt; ++$i) {
            $firstBit = $i > $firstInt ? 0 : $start & 0x1f;
            $lastBit = $i < $lastInt ? 31 : $end & 0x1f;

            if (0 === $firstBit && 31 === $lastBit) {
                $mask = 0x7fffffff;
            } else {
                $mask = 0;

                for ($j = $firstBit; $j < $lastBit; ++$j) {
                    $mask |= 1 << $j;
                }
            }

            $this->bits[$i] = $this->bits[$i] | $mask;
        }
    }
614333
public function fit(array $values) : void
    {
        if (empty($values)) {
            throw new InvalidArgumentException('Strategy must be fit with'
                . ' at least 1 value.');
        }

        $this->percentile = Stats::percentile($values, $this->p);
        $this->mad = Stats::mad($values) ?: EPSILON;
    }
64607
public function setFormat($format)
    {
        if ($format !== self::FORMAT_BINARY && $format !== self::FORMAT_TEXT) {
            throw new InvalidArgumentException("Invalid message format");
        }

        $this->format = $format;
    }
102230
private function setError($error): void
    {
        if (false === is_int($error)) {
            throw new \InvalidArgumentException('Upload file error status must be an integer');
        }

        if (false === in_array($error, self::$errors)) {
            throw new \InvalidArgumentException('Invalid error status for UploadedFile');
        }

        $this->error = $error;
    }