sharkpy.saving ============== .. py:module:: sharkpy.saving Functions --------- .. autoapisummary:: sharkpy.saving.save_model sharkpy.saving.load_model Module Contents --------------- .. py:function:: save_model(self, model, name='shark_model', directory='models') Save the trained model to a .joblib file with enhanced error handling. :param model: Trained ML model object :type model: object :param name: Filename without extension (default: "shark_model") :type name: str, optional :param directory: Folder where the model will be saved (default: "models") :type directory: str, optional :returns: Path to the saved model if successful :rtype: str :raises ValueError: If model is None or not trained :raises OSError: If directory creation or file writing fails .. py:function:: load_model(self, model_path) Load a saved SharkPy model from a .joblib file with enhanced error handling. :param model_path: Path to the saved .joblib model file :type model_path: str :returns: The loaded model object :rtype: object :raises FileNotFoundError: If model file doesn't exist :raises ValueError: If file is not a valid model