paddlets.utils.utils

check_model_fitted(model: Trainable, msg: Optional[str] = None)[source]

check if model has fitted, Raise Exception if not fitted

Parameters
  • model (Trainable) – model instance.

  • msg (str) – str, default=None The default error message is, “This %(name)s instance is not fitted yet. Call ‘fit’ with appropriate arguments before using this estimator.” For custom messages if “%(name)s” is present in the message string, it is substituted for the estimator name. Eg. : “Estimator, %(name)s, must be fitted before sparsifying”.

Returns

None

Raises

ValueError

get_uuid(prefix: str = '', suffix: str = '')[source]

Get a random string of 16 characters.

Parameters
  • prefix (str, optional) – The prefix of the returned string.

  • suffix (str, optional) – The suffix of the returned string.

Returns

String of 16 characters.

Return type

str