Class Predictors


  • public final class Predictors
    extends Object
    Class with basic factory methods for initializing and discover models.
    • 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.