public class TrainingParameters extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALGORITHM_PARAM |
static String |
CUTOFF_PARAM |
static String |
ITERATIONS_PARAM |
static String |
THREADS_PARAM |
static String |
TRAINER_TYPE_PARAM |
Constructor and Description |
---|
TrainingParameters() |
TrainingParameters(InputStream in) |
TrainingParameters(Map<String,String> map)
Deprecated.
|
TrainingParameters(TrainingParameters trainingParameters) |
Modifier and Type | Method and Description |
---|---|
String |
algorithm()
Retrieves the training algorithm name.
|
String |
algorithm(String namespace)
Retrieves the training algorithm name for a given name space.
|
static TrainingParameters |
defaultParams() |
boolean |
getBooleanParameter(String key,
boolean defaultValue)
get a Boolean parameter
|
boolean |
getBooleanParameter(String namespace,
String key,
boolean defaultValue)
get a Boolean parameter in the specified namespace
|
double |
getDoubleParameter(String key,
double defaultValue)
get a Double parameter
|
double |
getDoubleParameter(String namespace,
String key,
double defaultValue)
get a Double parameter in the specified namespace
|
int |
getIntParameter(String key,
int defaultValue)
get an Integer parameter
|
int |
getIntParameter(String namespace,
String key,
int defaultValue)
get an Integer parameter in the specified namespace
|
Map<String,Object> |
getObjectSettings()
Retrieves all parameters without a name space.
|
Map<String,Object> |
getObjectSettings(String namespace)
Retrieves a map with the training parameters which have the passed name space.
|
TrainingParameters |
getParameters(String namespace) |
Map<String,String> |
getSettings()
Deprecated.
use
getObjectSettings() instead |
Map<String,String> |
getSettings(String namespace)
Deprecated.
use
getObjectSettings(String) instead |
String |
getStringParameter(String key,
String defaultValue)
get a String parameter.
|
String |
getStringParameter(String namespace,
String key,
String defaultValue)
get a String parameter in the specified namespace.
|
void |
put(String key,
boolean value) |
void |
put(String key,
double value) |
void |
put(String key,
int value) |
void |
put(String key,
String value) |
void |
put(String namespace,
String key,
boolean value) |
void |
put(String namespace,
String key,
double value) |
void |
put(String namespace,
String key,
int value) |
void |
put(String namespace,
String key,
String value) |
void |
putIfAbsent(String key,
boolean value) |
void |
putIfAbsent(String key,
double value) |
void |
putIfAbsent(String key,
int value) |
void |
putIfAbsent(String key,
String value) |
void |
putIfAbsent(String namespace,
String key,
boolean value) |
void |
putIfAbsent(String namespace,
String key,
double value) |
void |
putIfAbsent(String namespace,
String key,
int value) |
void |
putIfAbsent(String namespace,
String key,
String value) |
void |
serialize(OutputStream out) |
public static final String ALGORITHM_PARAM
public static final String TRAINER_TYPE_PARAM
public static final String ITERATIONS_PARAM
public static final String CUTOFF_PARAM
public static final String THREADS_PARAM
public TrainingParameters()
public TrainingParameters(TrainingParameters trainingParameters)
public TrainingParameters(InputStream in) throws IOException
IOException
public String algorithm(String namespace)
public String algorithm()
public Map<String,String> getSettings(String namespace)
getObjectSettings(String)
insteadnamespace
- public Map<String,String> getSettings()
getObjectSettings()
insteadpublic Map<String,Object> getObjectSettings(String namespace)
namespace
- public Map<String,Object> getObjectSettings()
public TrainingParameters getParameters(String namespace)
public void putIfAbsent(String key, int value)
public void putIfAbsent(String key, double value)
public void putIfAbsent(String key, boolean value)
public void put(String key, int value)
public void put(String key, double value)
public void put(String key, boolean value)
public void serialize(OutputStream out) throws IOException
IOException
public String getStringParameter(String key, String defaultValue)
ClassCastException
can be thrown if the value is not String
key
- defaultValue
- public String getStringParameter(String namespace, String key, String defaultValue)
ClassCastException
can be thrown if the value is not String
namespace
- key
- defaultValue
- public int getIntParameter(String key, int defaultValue)
key
- defaultValue
- public int getIntParameter(String namespace, String key, int defaultValue)
namespace
- key
- defaultValue
- public double getDoubleParameter(String key, double defaultValue)
key
- defaultValue
- public double getDoubleParameter(String namespace, String key, double defaultValue)
namespace
- key
- defaultValue
- public boolean getBooleanParameter(String key, boolean defaultValue)
key
- defaultValue
- public boolean getBooleanParameter(String namespace, String key, boolean defaultValue)
namespace
- key
- defaultValue
- public static TrainingParameters defaultParams()
Copyright © 2021 The Apache Software Foundation. All rights reserved.