@ConfigDelegate(value=AlgorithmInstanceBuilderDelegate.class) public class AlgorithmInstanceBuilder extends Object implements org.apache.commons.lang3.builder.Builder<AlgorithmInstance>
Constructor and Description |
---|
AlgorithmInstanceBuilder() |
AlgorithmInstanceBuilder(String name) |
Modifier and Type | Method and Description |
---|---|
AlgorithmInstance |
build() |
AlgorithmInstanceBuilder |
configureFromFile(Map<String,Object> attributes,
File file)
Configure the algorithmInfo instance builder from a file.
|
Map<String,Object> |
getAttributes()
Get the attributes of this algorithmInfo instance.
|
LenskitConfiguration |
getConfig() |
String |
getName()
Get the algorithmInfo name.
|
boolean |
getPreload()
Get whether this algorithmInfo will require ratings to be pre-loaded.
|
EvalProject |
getProject()
Get the project of this algorithmInfo
|
AlgorithmInstanceBuilder |
setAttribute(String attr,
Object value)
Set an attribute for this algorithmInfo instance.
|
AlgorithmInstanceBuilder |
setName(String n)
Set the algorithmInfo name.
|
AlgorithmInstanceBuilder |
setPreload(boolean pl)
Deprecated.
This method doesn't do anything anymore. Pack rating data if you want
preloading.
|
AlgorithmInstanceBuilder |
setProject(EvalProject prj)
Set the project of Algorithm.
|
public AlgorithmInstanceBuilder()
public AlgorithmInstanceBuilder(String name)
public AlgorithmInstanceBuilder setName(String n)
n
- The name for this algorithmInfo instance.public String getName()
public boolean getPreload()
true
if the algorithmInfo should have ratings pre-loaded into memory.public EvalProject getProject()
@Deprecated public AlgorithmInstanceBuilder setPreload(boolean pl)
pl
- true
to pre-load input data when running this algorithmInfo.public AlgorithmInstanceBuilder setAttribute(@Nonnull String attr, @Nonnull Object value)
attr
- The attribute name.value
- The attribute value.public AlgorithmInstanceBuilder setProject(EvalProject prj)
prj
- The project for this algorithmInfo.public Map<String,Object> getAttributes()
public LenskitConfiguration getConfig()
public AlgorithmInstanceBuilder configureFromFile(Map<String,Object> attributes, File file) throws RecommenderConfigurationException, IOException
attributes
- The attributes. Attributes 'name' and 'preload' are mapped to their
corresponding real properties.file
- The file.RecommenderConfigurationException
- If there is an error running the script.IOException
- If there is an error loading the script.public AlgorithmInstance build()
build
in interface org.apache.commons.lang3.builder.Builder<AlgorithmInstance>