Tabnine Logo
org.lenskit
Code IndexAdd Tabnine to your IDE (free)

How to use org.lenskit

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

origin: lenskit/lenskit

/**
 * Construct a recommender with some additional configuration.  This can be used to do things
 * like add data source configuration on a per-recommender, rather than per-engine, basis.
 *
 * @param config The configuration to adjust the recommender.
 * @return The constructed recommender.
 * @throws RecommenderConfigurationException if there is an error configuring the recommender.
 */
public LenskitRecommender createRecommender(LenskitConfiguration config) throws RecommenderConfigurationException {
  final DAGNode<Component, Dependency> toBuild = createRecommenderGraph(config);
  return new LenskitRecommender(toBuild);
}
origin: lenskit/lenskit

/**
 * Build a LensKit recommender engine from a configuration.  The resulting recommender is
 * independent of any subsequent modifications to the configuration.
 *
 * @param config     The configuration.
 * @param dao The data access object
 * @return The recommender engine.
 */
public static LenskitRecommenderEngine build(LenskitConfiguration config, DataAccessObject dao) throws RecommenderBuildException {
  return newBuilder().addConfiguration(config).build(dao);
}
origin: lenskit/lenskit

protected LenskitConfiguration getDaoConfig() {
  LenskitConfiguration config = new LenskitConfiguration();
  config.bind(DataAccessObject.class)
     .toProvider(source);
  return config;
}
origin: lenskit/lenskit

/**
 * Create a LensKit recommender.
 * @param dao The data access object
 * @return The constructed recommender.
 */
public LenskitRecommender createRecommender(@WillNotClose DataAccessObject dao) throws RecommenderBuildException {
  LenskitConfiguration config = new LenskitConfiguration();
  config.addComponent(dao);
  return createRecommender(config);
}
origin: lenskit/lenskit

/**
 * Construct a new delegate with an empty configuration.
 *
 * @param loader The configuration loader
 * @param base   The base URL
 */
public LenskitConfigDSL(ConfigurationLoader loader, URI base) {
  this(loader, new LenskitConfiguration(), base);
}
origin: lenskit/lenskit

/**
 * Build the recommender directly, skipping an engine.  This does not separate the recommender from
 * the DAO, it just directly builds it.
 *
 * @param dao The data access object to use.  Can be `null` to build without a DAO, but this is only useful in
 *            special cases.
 * @return The built recommender engine, with {@linkplain ModelDisposition#EXCLUDED excluded}
 *         components removed.
 * @throws RecommenderBuildException if there is an error building the engine.
 */
public LenskitRecommender buildRecommender(DataAccessObject dao) throws RecommenderBuildException {
  DAGNode<Component, Dependency> graph = buildRecommenderGraph(dao);
  graph = instantiateGraph(graph);
  return new LenskitRecommender(graph);
}
origin: lenskit/lenskit

@Override
public ItemRecommender getItemRecommender() {
  return get(ItemRecommender.class);
}
origin: lenskit/lenskit

/** @see LenskitConfigContext#bind(Class) */
@Override
public <T> LenskitBinding<T> bind(Class<T> type) {
  return context.bind(type);
}
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

/**
 * Add a configuration to be included in the recommender engine.  This is the equivalent of
 * calling {@link #addConfiguration(LenskitConfiguration, ModelDisposition)} with the {@link ModelDisposition#INCLUDED}.
 * @param config The configuration.
 * @return The builder (for chaining).
 */
public LenskitRecommenderEngineBuilder addConfiguration(LenskitConfiguration config) {
  return addConfiguration(config, ModelDisposition.INCLUDED);
}
origin: lenskit/lenskit

/**
 * Add a root type.
 * @param type The type to add.
 * @see LenskitConfiguration#addRoot(Class)
 */
public void root(Class<?> type) {
  config.addRoot(type);
}
origin: lenskit/lenskit

/** @see LenskitConfigContext#within(Class) */
@Override
public LenskitConfigContext within(Class<?> type) {
  return context.within(type);
}
origin: lenskit/lenskit

/**
 * Create a new recommender engine builder.
 * @return A new recommender engine builder.
 */
public static LenskitRecommenderEngineBuilder newBuilder() {
  return new LenskitRecommenderEngineBuilder();
}
origin: lenskit/lenskit

  /**
   * Create a new recommender engine loader.
   * @return A new recommender engine loader.
   */
  public static LenskitRecommenderEngineLoader newLoader() {
    return new LenskitRecommenderEngineLoader();
  }
}
origin: lenskit/lenskit

/** @see LenskitConfigContext#bindAny(Class) */
@Override
public <T> LenskitBinding<T> bindAny(Class<T> type) {
  return context.bindAny(type);
}
origin: lenskit/lenskit

/** @see LenskitConfigContext#at(Class) */
@Override
public LenskitConfigContext at(Class<?> type) {
  return context.at(type);
}
origin: lenskit/lenskit

/**
 * Build a LensKit recommender engine from a configuration.  The resulting recommender is
 * independent of any subsequent modifications to the configuration.
 *
 * @param config     The configuration.
 * @return The recommender engine.
 */
@SuppressWarnings("deprecation")
public static LenskitRecommenderEngine build(LenskitConfiguration config) throws RecommenderBuildException {
  return newBuilder().addConfiguration(config).build();
}
origin: lenskit/lenskit

/**
 * Convenience method to copy a LensKit configuration.
 * @return An independent copy of this configuration.
 */
public LenskitConfiguration copy() {
  return new LenskitConfiguration(this);
}
origin: lenskit/lenskit

/** @see LenskitConfigContext#bind(Class, Class) */
@Override
public <T> LenskitBinding<T> bind(Class<? extends Annotation> qual, Class<T> type) {
  return context.bind(qual, type);
}
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);
}
org.lenskit

Most used classes

  • LenskitConfiguration
    A LensKit algorithm configuration. Once you have a configuration, you can pass it to LenskitRecommen
  • LenskitBinding
    LensKit-augmented binding interface.
  • Rating
    A user rating an item. A rating is an expression of preference, in the form of a real-valued rating,
  • LongUtils
    Utilities for working with longs and collections of them from Fastutil.
  • StaticDataSource
    Layout and builder for DAOs backed by static files. This is used to read CSV files and the like; it
  • Results,
  • LenskitRecommender,
  • LenskitRecommenderEngine,
  • DataAccessObject,
  • ResultMap,
  • PreferenceDomain,
  • Vectors,
  • ItemRecommender,
  • ItemScorer,
  • Query,
  • RatingBuilder,
  • Shareable,
  • Transient,
  • IdBox
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