public class LenskitRecommenderEngineBuilder extends Object
Builds LensKit recommender engines from configurations.
If multiple configurations are used, later configurations superseded previous configurations. This allows you to add a configuration of defaults, followed by a custom configuration. The final build process takes the union of the roots of all provided configurations as the roots of the configured object graph.
LenskitConfiguration
,
LenskitRecommenderEngine
Constructor and Description |
---|
LenskitRecommenderEngineBuilder() |
Modifier and Type | Method and Description |
---|---|
LenskitRecommenderEngineBuilder |
addConfiguration(LenskitConfiguration config)
Add a configuration to be included in the recommender engine.
|
LenskitRecommenderEngineBuilder |
addConfiguration(LenskitConfiguration config,
ModelDisposition disp)
Add a configuration to be used when building the engine.
|
LenskitRecommenderEngine |
build()
Deprecated.
|
LenskitRecommenderEngine |
build(DataAccessObject dao)
Build the recommender engine.
|
ClassLoader |
getClassLoader()
Get the class loader this builder will use.
|
LenskitRecommenderEngineBuilder |
setClassLoader(ClassLoader loader)
Set the class loader to use.
|
public ClassLoader getClassLoader()
Get the class loader this builder will use. By default, it uses the thread’s current context class loader (if set).
public LenskitRecommenderEngineBuilder setClassLoader(ClassLoader loader)
Set the class loader to use.
loader
- The class loader to use when building the recommender.public LenskitRecommenderEngineBuilder addConfiguration(LenskitConfiguration config)
Add a configuration to be included in the recommender engine. This is the equivalent of calling addConfiguration(LenskitConfiguration, ModelDisposition)
with the ModelDisposition.INCLUDED
.
config
- The configuration.public LenskitRecommenderEngineBuilder addConfiguration(LenskitConfiguration config, ModelDisposition disp)
Add a configuration to be used when building the engine.
config
- The configuration.disp
- The disposition for this configuration.@Deprecated public LenskitRecommenderEngine build() throws RecommenderBuildException
build(DataAccessObject)
Build the recommender engine.
RecommenderBuildException
public LenskitRecommenderEngine build(DataAccessObject dao) throws RecommenderBuildException
Build the recommender engine.
dao
- The data access object to use. Can be null
to build without a DAO, but this is only useful in special cases.RecommenderBuildException