@Test public void testVoidModelLoaderOfModelToLoad() { assertThatThrownBy( () -> ClassificationValidationUtils.validateParamsModelToLoad( null, VALID_PATH, SCHEMA, VALID_PARAM_MAP )) .isInstanceOf(NullPointerException.class) .hasMessageContaining(NULL_ERROR_MSG); }
public static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader, final Path modelPath, final DatasetSchema schema, final Map<String, String> params) throws ModelLoadingException { Preconditions.checkNotNull(modelLoader, "modelLoader cannot be null"); Preconditions.checkNotNull(modelPath, "modelPath cannot be null"); Preconditions.checkNotNull(schema, "schema cannot be null"); Preconditions.checkNotNull(params, "params cannot be null"); logger.debug("Validating the parameters of the model in path [{}]", modelPath); final List<ParamValidationError> validationErrors = modelLoader.validateForLoad( modelPath, schema, params ); if (!validationErrors.isEmpty()) { final String errorMsg = validationErrors.stream() .map(ParamValidationError::getMessage) .collect(Collectors.joining(",")); throw new ModelLoadingException(errorMsg); } logger.debug("Parameters of the model in path [{}] successfully validated", modelPath); }
ClassificationValidationUtils { public static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader, final Path modelPath, final DatasetSchema schema, final Map<String, String> params) throws ModelLoadingException { Preconditions.checkNotNull(modelLoader, "modelLoader cannot be null"); Preconditions.checkNotNull(modelPath, "modelPath cannot be null"); Preconditions.checkNotNull(schema, "schema cannot be null"); Preconditions.checkNotNull(params, "params cannot be null"); logger.debug("Validating the parameters of the model in path [{}]", modelPath); final List<ParamValidationError> validationErrors = modelLoader.validateForLoad( modelPath, schema, params ); if (!validationErrors.isEmpty()) { final String errorMsg = validationErrors.stream() .map(ParamValidationError::getMessage) .collect(Collectors.joining(",")); throw new ModelLoadingException(errorMsg); } logger.debug("Parameters of the model in path [{}] successfully validated", modelPath); } }
ClassificationValidationUtils { public static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader, final Path modelPath, final DatasetSchema schema, final Map<String, String> params) throws ModelLoadingException { Preconditions.checkNotNull(modelLoader, "modelLoader cannot be null"); Preconditions.checkNotNull(modelPath, "modelPath cannot be null"); Preconditions.checkNotNull(schema, "schema cannot be null"); Preconditions.checkNotNull(params, "params cannot be null"); logger.debug("Validating the parameters of the model in path [{}]", modelPath); final List<ParamValidationError> validationErrors = modelLoader.validateForLoad( modelPath, schema, params ); if (!validationErrors.isEmpty()) { final String errorMsg = validationErrors.stream() .map(ParamValidationError::getMessage) .collect(Collectors.joining(",")); throw new ModelLoadingException(errorMsg); } logger.debug("Parameters of the model in path [{}] successfully validated", modelPath); } private  ClassificationValidationUtils(); }
ClassificationValidationUtils { public static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader, final Path modelPath, final DatasetSchema schema, final Map<String, String> params) throws ModelLoadingException { Preconditions.checkNotNull(modelLoader, "modelLoader cannot be null"); Preconditions.checkNotNull(modelPath, "modelPath cannot be null"); Preconditions.checkNotNull(schema, "schema cannot be null"); Preconditions.checkNotNull(params, "params cannot be null"); logger.debug("Validating the parameters of the model in path [{}]", modelPath); final List<ParamValidationError> validationErrors = modelLoader.validateForLoad( modelPath, schema, params ); if (!validationErrors.isEmpty()) { final String errorMsg = validationErrors.stream() .map(ParamValidationError::getMessage) .collect(Collectors.joining(",")); throw new ModelLoadingException(errorMsg); } logger.debug("Parameters of the model in path [{}] successfully validated", modelPath); } private  ClassificationValidationUtils(); static void validateClassificationModel(final DatasetSchema schema,
                                                   final ClassificationMLModel model); static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader,
                                                 final Path modelPath,
                                                 final DatasetSchema schema,
                                                 final Map<String, String> params); }
ClassificationValidationUtils { public static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader, final Path modelPath, final DatasetSchema schema, final Map<String, String> params) throws ModelLoadingException { Preconditions.checkNotNull(modelLoader, "modelLoader cannot be null"); Preconditions.checkNotNull(modelPath, "modelPath cannot be null"); Preconditions.checkNotNull(schema, "schema cannot be null"); Preconditions.checkNotNull(params, "params cannot be null"); logger.debug("Validating the parameters of the model in path [{}]", modelPath); final List<ParamValidationError> validationErrors = modelLoader.validateForLoad( modelPath, schema, params ); if (!validationErrors.isEmpty()) { final String errorMsg = validationErrors.stream() .map(ParamValidationError::getMessage) .collect(Collectors.joining(",")); throw new ModelLoadingException(errorMsg); } logger.debug("Parameters of the model in path [{}] successfully validated", modelPath); } private  ClassificationValidationUtils(); static void validateClassificationModel(final DatasetSchema schema,
                                                   final ClassificationMLModel model); static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader,
                                                 final Path modelPath,
                                                 final DatasetSchema schema,
                                                 final Map<String, String> params);  }