congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
LenskitRecommenderEngineLoader.load
Code IndexAdd Tabnine to your IDE (free)

How to use
load
method
in
org.lenskit.LenskitRecommenderEngineLoader

Best Java code snippets using org.lenskit.LenskitRecommenderEngineLoader.load (Showing top 8 results out of 315)

origin: lenskit/lenskit

/**
 * 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)}.
 * Classes will be loaded using a default class loader.
 *
 * @param file The file from which to load the engine.
 * @return The loaded recommender engine.
 * @throws IOException If there is an error reading from the file.
 * @throws RecommenderConfigurationException
 *                     If the configuration cannot be used.
 */
public static LenskitRecommenderEngine load(File file) throws IOException, RecommenderConfigurationException {
  return newLoader().load(file);
}
origin: lenskit/lenskit

/**
 * Create a new recommender engine by reading a previously serialized engine from the
 * given input stream. The new engine will be identical to the old. It is assumed that the file
 * was created by using {@link #write(OutputStream)}.  Classes will be loaded using a default
 * class loader.
 *
 * @param input The stream from which to load the engine.
 * @return The loaded recommender engine.
 * @throws IOException If there is an error reading from the file.
 * @throws RecommenderConfigurationException
 *                     If the configuration cannot be used.
 */
public static LenskitRecommenderEngine load(InputStream input) throws IOException, RecommenderConfigurationException {
  return newLoader().load(input);
}
origin: lenskit/lenskit

/**
 * 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);
}
origin: lenskit/lenskit

try {
  input = CompressionMode.autodetect(modelFile).wrapInput(input);
  engine = loader.load(input);
} finally {
  input.close();
origin: lenskit/lenskit

/**
 * Load a configuration graph from a recommender model.
 * @param file The model file.
 * @return The recommender graph.
 * @throws IOException if there is an error loading the model.
 * @throws RecommenderConfigurationException if the model fails to configure.
 */
private DAGNode<Component, Dependency> loadModel(Context ctx, File file) throws IOException, RecommenderConfigurationException {
  logger.info("loading model from {}", file);
  LenskitRecommenderEngineLoader loader = LenskitRecommenderEngine.newLoader();
  loader.setValidationMode(EngineValidationMode.DEFERRED)
     .addConfiguration(makeDataConfig(ctx));
  for (LenskitConfiguration config: ctx.environment.loadConfigurations(ctx.getConfigFiles())) {
    loader.addConfiguration(config);
  }
  LenskitRecommenderEngine engine = loader.load(file);
  return engine.getGraph();
}
origin: org.lenskit/lenskit-core

/**
 * 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)}.
 * Classes will be loaded using a default class loader.
 *
 * @param file The file from which to load the engine.
 * @return The loaded recommender engine.
 * @throws IOException If there is an error reading from the file.
 * @throws RecommenderConfigurationException
 *                     If the configuration cannot be used.
 */
public static LenskitRecommenderEngine load(File file) throws IOException, RecommenderConfigurationException {
  return newLoader().load(file);
}
origin: org.lenskit/lenskit-core

/**
 * Create a new recommender engine by reading a previously serialized engine from the
 * given input stream. The new engine will be identical to the old. It is assumed that the file
 * was created by using {@link #write(OutputStream)}.  Classes will be loaded using a default
 * class loader.
 *
 * @param input The stream from which to load the engine.
 * @return The loaded recommender engine.
 * @throws IOException If there is an error reading from the file.
 * @throws RecommenderConfigurationException
 *                     If the configuration cannot be used.
 */
public static LenskitRecommenderEngine load(InputStream input) throws IOException, RecommenderConfigurationException {
  return newLoader().load(input);
}
origin: org.lenskit/lenskit-core

/**
 * 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);
}
org.lenskitLenskitRecommenderEngineLoaderload

Javadoc

Load a recommender from a file.

Popular methods of LenskitRecommenderEngineLoader

  • setClassLoader
    Set the class loader to use when reading the engine.
  • <init>
  • loadInternal
    Load a recommender engine from an input stream. It transparently decompresses the stream and handles
  • readGraph
    Read a graph from an object input stream. Broken out to localize the necessary warning suppression.
  • addConfiguration
    Add a configuration to use when loading the configuration. The loaded graph will be post-processed t
  • setValidationMode
    Set the validation mode for loading the recommender engine. The default mode is EngineValidationMode

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now