Package com.datarobot.prediction
Class Predictors
- java.lang.Object
-
- com.datarobot.prediction.Predictors
-
public final class Predictors extends Object
Class with basic factory methods for initializing and discover models.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Predictors.Constants
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Iterator<IPredictorInfo>
getAllPredictors()
See all predictors loaded in the classpath.static Iterator<IPredictorInfo>
getAllPredictors(ClassLoader classLoader)
Retrieve all predictors from the classloader.static Iterator<IPredictorInfo>
getAllPredictorsFromJarFile(String jarPath)
Retrieve all predictors from the jar file.static <T extends IPredictorInfo>
TgetPredictor()
Retrieve a single DataRobot model, if it is the only one in classpath.static <T extends IPredictorInfo>
TgetPredictor(ClassLoader classLoader)
Retrieve a single DataRobot model, if it is the only one in the specified classloader.static <T extends IPredictorInfo>
TgetPredictor(String modelId)
Get DataRobot model by modelId.static <T extends IPredictorInfo>
TgetPredictor(String modelId, ClassLoader classLoader)
Get DataRobot model from the classloader by model id.static <T extends IPredictorInfo>
TgetPredictorFromJarFile(String jarPath)
Retrieve a single DataRobot model, if it is the only one in classpath.static <T extends IPredictorInfo>
TgetPredictorFromJarFile(String jarPath, String modelId)
Get DataRobot model from the jar file by model id.
-
-
-
Method Detail
-
getPredictor
public static <T extends IPredictorInfo> T getPredictor()
Retrieve a single DataRobot model, if it is the only one in classpath.- Type Parameters:
T
- Type of the model- Returns:
- implementation of the model.
-
getPredictor
public static <T extends IPredictorInfo> T getPredictor(ClassLoader classLoader)
Retrieve a single DataRobot model, if it is the only one in the specified classloader.- Type Parameters:
T
- - type of the model.- Parameters:
classLoader
- - classloader where to search for the model.- Returns:
- instance of the implementation.
-
getPredictor
public static <T extends IPredictorInfo> T getPredictor(String modelId)
Get DataRobot model by modelId.- Type Parameters:
T
- type of the model.- Parameters:
modelId
- model id.- Returns:
- instance of the implementation.
-
getPredictor
public static <T extends IPredictorInfo> T getPredictor(String modelId, ClassLoader classLoader)
Get DataRobot model from the classloader by model id.- Type Parameters:
T
- type of the model.- Parameters:
modelId
- model id.classLoader
- classloader.- Returns:
- instance of the implementation.
-
getAllPredictors
public static Iterator<IPredictorInfo> getAllPredictors()
See all predictors loaded in the classpath.- Returns:
- all DataRobot models.
-
getPredictorFromJarFile
public static <T extends IPredictorInfo> T getPredictorFromJarFile(String jarPath, String modelId)
Get DataRobot model from the jar file by model id.- Type Parameters:
T
- type of the model.- Parameters:
jarPath
- path to jar file with model.modelId
- model id.- Returns:
- instance of the implementation.
-
getPredictorFromJarFile
public static <T extends IPredictorInfo> T getPredictorFromJarFile(String jarPath)
Retrieve a single DataRobot model, if it is the only one in classpath.- Type Parameters:
T
- type of the model.- Parameters:
jarPath
- path to jar file with model.- Returns:
- instance of the implementation.
-
getAllPredictorsFromJarFile
public static Iterator<IPredictorInfo> getAllPredictorsFromJarFile(String jarPath)
Retrieve all predictors from the jar file.- Parameters:
jarPath
- path to jar file with model.- Returns:
- all DataRobot models.
-
getAllPredictors
public static Iterator<IPredictorInfo> getAllPredictors(ClassLoader classLoader)
Retrieve all predictors from the classloader.- Parameters:
classLoader
- classloader with model.- Returns:
- all DataRobot models.
-
-