|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.metrics.MetricLearner
weka.core.metrics.AttrEvalMetricLearner
AttrEvalMetricLearner - sets the weights of a metric using scores from an attribute evaluator
Field Summary | |
protected ASEvaluation |
m_evaluator
The attribute evaluator used |
protected LearnableMetric |
m_metric
The metric that the classifier was used to learn, useful for external-calculation based metrics |
Constructor Summary | |
AttrEvalMetricLearner()
Create a new attribute evaluator metric learner |
Method Summary | |
static java.lang.String |
concatStringArray(java.lang.String[] strings)
A little helper to create a single String from an array of Strings |
double |
getDistance(Instance instance1,
Instance instance2)
Use the Classifier for an estimation of distance |
ASEvaluation |
getEvaluator()
Get the evaluator |
java.lang.String[] |
getOptions()
Gets the current settings of WeightedDotP. |
double |
getSimilarity(Instance instance1,
Instance instance2)
Use the Classifier for an estimation of similarity |
protected static java.lang.String |
getTimestamp()
Gets a string containing current date and time. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
protected double[] |
normalizeWeights(double[] weights)
Normalize weights |
void |
setEvaluator(ASEvaluation evaluator)
Set the evaluator |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
java.lang.String |
toString()
Obtain a textual description of the metriclearner |
void |
trainMetric(LearnableMetric metric,
Instances instances)
Train a given met7ric using given training instances |
Methods inherited from class weka.core.metrics.MetricLearner |
createDiffInstanceLists, createDiffInstances, createDiffInstances, forName, getAttrInfoForDiffInstance |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected LearnableMetric m_metric
protected ASEvaluation m_evaluator
Constructor Detail |
public AttrEvalMetricLearner()
Method Detail |
public void trainMetric(LearnableMetric metric, Instances instances) throws java.lang.Exception
trainMetric
in class MetricLearner
metric
- the metric to traininstances
- data to train the metric on
java.lang.Exception
- if training has gone bad.protected double[] normalizeWeights(double[] weights)
weights
- an unnormalized array of weights
public double getSimilarity(Instance instance1, Instance instance2) throws java.lang.Exception
getSimilarity
in class MetricLearner
instance1
- first instance of a pairinstance2
- second instance of a pair
java.lang.Exception
public double getDistance(Instance instance1, Instance instance2) throws java.lang.Exception
getDistance
in class MetricLearner
instance1
- first instance of a pairinstance2
- second instance of a pair
java.lang.Exception
public void setEvaluator(ASEvaluation evaluator) throws java.lang.Exception
java.lang.Exception
public ASEvaluation getEvaluator()
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-B classifierstring
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedprotected static java.lang.String getTimestamp()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public java.lang.String toString()
public static java.lang.String concatStringArray(java.lang.String[] strings)
strings
- an array of strings
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |