mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-06-07 02:50:48 +00:00
8f122fde90
* Models manager with save/restore capabilities * Refactoring dataset exceptions * Persistency layer docs * New tests for serializable estimators * ModelManager static methods to instance methods
31 lines
595 B
PHP
31 lines
595 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Phpml\Exception;
|
|
|
|
class SerializeException extends \Exception
|
|
{
|
|
|
|
/**
|
|
* @param string $filepath
|
|
*
|
|
* @return SerializeException
|
|
*/
|
|
public static function cantUnserialize(string $filepath)
|
|
{
|
|
return new self(sprintf('"%s" can not be unserialized.', $filepath));
|
|
}
|
|
|
|
/**
|
|
* @param string $classname
|
|
*
|
|
* @return SerializeException
|
|
*/
|
|
public static function cantSerialize(string $classname)
|
|
{
|
|
return new self(sprintf('Class "%s" can not be serialized.', $classname));
|
|
}
|
|
|
|
}
|