public class LenskitRecommender extends Object implements Recommender
LenskitRecommenderEngine
will produce this type of
recommender.
The Recommender
interface will meet most needs, so most users can
ignore this class. However, if you need to inspect internal components of a
recommender (e.g. extract the item-item similarity matrix), this class and its
get(Class)
method can be useful.
Constructor and Description |
---|
LenskitRecommender(DAGNode<Component,Dependency> graph)
Create a new LensKit recommender.
|
Modifier and Type | Method and Description |
---|---|
static LenskitRecommender |
build(LenskitConfiguration config)
Build a recommender from a configuration.
|
<T> T |
get(Annotation qual,
Class<T> cls)
Get a particular qualified component from the recommender session.
|
<T> T |
get(Class<? extends Annotation> qual,
Class<T> cls)
Get a particular qualified component from the recommender session.
|
<T> T |
get(Class<T> cls)
Get a particular component from the recommender session.
|
GlobalItemRecommender |
getGlobalItemRecommender()
Get the recommender's global item recommender.
|
GlobalItemScorer |
getGlobalItemScorer()
Get the recommender's global item scorer.
|
ItemRecommender |
getItemRecommender()
Get the recommender's item recommender.
|
ItemScorer |
getItemScorer()
Get the recommender's item scorer.
|
RatingPredictor |
getRatingPredictor()
Get the recommender's rating scorer.
|
public LenskitRecommender(DAGNode<Component,Dependency> graph)
build(LenskitConfiguration)
or a LenskitRecommenderEngine
.graph
- This recommender's configuration graph.public <T> T get(Class<T> cls)
T
- The type of component to get.cls
- The component class to get.public <T> T get(Class<? extends Annotation> qual, Class<T> cls)
T
- The type of component to get.qual
- The qualifying annotation of the component class.cls
- The component class to get.public <T> T get(Annotation qual, Class<T> cls)
T
- The type of component to get.qual
- The qualifying annotation of the component class.cls
- The component class to get.public ItemScorer getItemScorer()
Recommender
getItemScorer
in interface Recommender
null
if item scoring is not supported.public GlobalItemScorer getGlobalItemScorer()
Recommender
getGlobalItemScorer
in interface Recommender
null
if item scoring is not supported.public RatingPredictor getRatingPredictor()
Recommender
getRatingPredictor
in interface Recommender
null
if rating prediction is not supported.public ItemRecommender getItemRecommender()
Recommender
getItemRecommender
in interface Recommender
null
if item recommendation is not supported.public GlobalItemRecommender getGlobalItemRecommender()
Recommender
getGlobalItemRecommender
in interface Recommender
null
if item recommendation is not supported.public static LenskitRecommender build(LenskitConfiguration config) throws RecommenderBuildException
config
- The configuration.RecommenderBuildException
- If there is an error building the recommender.