/** * Create a new recommender engine by reading a previously serialized engine from the * given file. The new engine will be identical to the old except it will use the new * DAOFactory. It is assumed that the file was created by using {@link #write(OutputStream)}. * * @param file The file from which to load the engine. * @param loader The class loader to load from ({@code null} to use a default class loader). * @return The loaded recommender engine. * @throws IOException If there is an error reading from the file. * @throws RecommenderConfigurationException * If the configuration cannot be used. * @deprecated Use {@link LenskitRecommenderEngineLoader} for sophisticated loading. */ @Deprecated public static LenskitRecommenderEngine load(File file, ClassLoader loader) throws IOException, RecommenderConfigurationException { return newLoader().setClassLoader(loader).load(file); }
logger.info("loading recommender from {}", modelFile); LenskitRecommenderEngineLoader loader = LenskitRecommenderEngine.newLoader(); loader.setClassLoader(environment.getClassLoader()); for (LenskitConfiguration config: environment.loadConfigurations(getConfigFiles())) { loader.addConfiguration(config);
/** * Create a new recommender engine by reading a previously serialized engine from the * given file. The new engine will be identical to the old except it will use the new * DAOFactory. It is assumed that the file was created by using {@link #write(OutputStream)}. * * @param file The file from which to load the engine. * @param loader The class loader to load from ({@code null} to use a default class loader). * @return The loaded recommender engine. * @throws IOException If there is an error reading from the file. * @throws RecommenderConfigurationException * If the configuration cannot be used. * @deprecated Use {@link LenskitRecommenderEngineLoader} for sophisticated loading. */ @Deprecated public static LenskitRecommenderEngine load(File file, ClassLoader loader) throws IOException, RecommenderConfigurationException { return newLoader().setClassLoader(loader).load(file); }