public abstract class AbstractClassificationPythonModelLoaderImpl extends Object implements com.feedzai.openml.provider.model.MachineLearningModelLoader<ClassificationPythonModel>
getModelImpl(DatasetSchema, JepInstance, String) method, and even then it can be made very easy if the
ClassificationPythonModel can be reused.| Constructor and Description |
|---|
AbstractClassificationPythonModelLoaderImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected ClassificationPythonModel |
getModelImpl(com.feedzai.openml.data.schema.DatasetSchema schema,
JepInstance jepInstance,
String id)
Gets the actual instance of the
MachineLearningModel to use. |
ClassificationPythonModel |
loadModel(Path modelPath,
com.feedzai.openml.data.schema.DatasetSchema schema) |
com.feedzai.openml.data.schema.DatasetSchema |
loadSchema(Path modelPath) |
protected abstract void |
modelLoadLogic(JepInstance jepInstance,
String id,
Path modelPath)
Specific implementation of python logic that loads the model.
|
List<com.feedzai.openml.provider.descriptor.fieldtype.ParamValidationError> |
validateForLoad(Path modelPath,
com.feedzai.openml.data.schema.DatasetSchema schema,
Map<String,String> params) |
public AbstractClassificationPythonModelLoaderImpl()
public ClassificationPythonModel loadModel(Path modelPath, com.feedzai.openml.data.schema.DatasetSchema schema) throws com.feedzai.openml.provider.exception.ModelLoadingException
loadModel in interface com.feedzai.openml.provider.model.MachineLearningModelLoader<ClassificationPythonModel>com.feedzai.openml.provider.exception.ModelLoadingExceptionprotected ClassificationPythonModel getModelImpl(com.feedzai.openml.data.schema.DatasetSchema schema, JepInstance jepInstance, String id)
MachineLearningModel to use.schema - The DatasetSchema of the incoming instances.jepInstance - The JepInstance that provides access to the python environment.id - The identifier that has been assigned to the model.protected abstract void modelLoadLogic(JepInstance jepInstance, String id, Path modelPath) throws InterruptedException, ExecutionException, com.feedzai.openml.provider.exception.ModelLoadingException
jepInstance - Instance of Jep that will store and handle the model.id - Name of the variable on the Jep environment that will hold the model.modelPath - Path to the model.InterruptedException - Exception that is thrown in case the Jep instance is closed during or before
the evaluation of the model loading function.ExecutionException - Exception that is thrown in case a JepException is thrown while loading the model.com.feedzai.openml.provider.exception.ModelLoadingException - Generic exception for problems that may occur during model loading.public List<com.feedzai.openml.provider.descriptor.fieldtype.ParamValidationError> validateForLoad(Path modelPath, com.feedzai.openml.data.schema.DatasetSchema schema, Map<String,String> params)
validateForLoad in interface com.feedzai.openml.provider.model.MachineLearningModelLoader<ClassificationPythonModel>public com.feedzai.openml.data.schema.DatasetSchema loadSchema(Path modelPath) throws com.feedzai.openml.provider.exception.ModelLoadingException
loadSchema in interface com.feedzai.openml.provider.model.MachineLearningModelLoader<ClassificationPythonModel>com.feedzai.openml.provider.exception.ModelLoadingExceptionCopyright © 2018 Feedzai. All rights reserved.