public class LearningClassifierExpression extends ClassifierExpression
Modifier and Type | Class and Description |
---|---|
static class |
LearningClassifierExpression.Clause
This class represents a clause in a
LearningClassifierExpression . |
Modifier and Type | Field and Description |
---|---|
Constant |
alpha
(¬ø) The desired confidence level for cross validation's confidence interval
output; argument to
alpha , which can only be specified when cval is
also specified. |
int |
alphaClauses
Counts the number of
alpha clauses, for error detection. |
StringBuffer |
attributeString
A string representation of the return type information for each feature.
|
boolean |
checkDiscreteValues
The
SemanticAnalysis pass will let this LearningClassifierExpression
know if the features it generates need to be checked for appropriateness in the context of
the enclosing ClassifierAssignment by setting this flag. |
int |
cvalClauses
Counts the number of
cval clauses for error detection. |
static double |
defaultAlpha
If no
alpha clause appears during cross validation, this constant is used. |
static InstanceCreationExpression |
defaultDiscreteLearner
If no learning algorithm is specified to learn a discrete classifier, this learner is used.
|
static String |
defaultPreExtract
If no
preExtract clause appears in the sources, this constant is used. |
static InstanceCreationExpression |
defaultRealLearner
If no learning algorithm is specified to learn a real classifier, this learner is used.
|
int |
encodingClauses
Counts the number of
encoding clauses for error detection. |
int |
evaluateClauses
Counts the number of
evaluate clauses for error detection. |
Expression |
evaluation
(ø) Tells this learning classifier how to produce a prediction during evaluation;
argument to
evaluate . |
ClassifierExpression |
extractor
(¬ø) The classifier that does feature extraction for this classifier; argument to
using . |
Constant |
featureEncoding
(ø) The encoding that the generated classifier will use when storing string data in
features.
|
Integer |
featuresStatus
The revision status of the LCE's features node.
|
int |
fromClauses
Counts the number of
from clauses for error detection. |
Constant |
K
(ø) Represents the integer number of subsets to be used in k-fold cross validation;
first argument to
cval . |
ClassifierExpression |
labeler
(ø) The classifier this learning classifier gets its labels from.
|
InstanceCreationExpression |
learnerConstructor
(ø) Tells this learning classifier how to construct its learning algorithm; argument
to
with . |
Name |
learnerName
(ø) The name of the learner for this classifier; first argument to
with . |
Block |
learnerParameterBlock
(ø) A block of statements that set parameters of the learner for this classifier;
second argument to
with . |
Integer |
learningStatus
The revision status of the LCE's learning node.
|
boolean |
onlyCodeGeneration
This flag is set
true iff the changes to the learner's LBJava specification
require its Java translation to be regenerated and nothing more. |
LinkedList<ParameterSet> |
parameterSets
A list of the
ParameterSet objects that appear in the argument list. |
InstanceCreationExpression |
parser
(ø) Tells this learning classifier how to get its training data; argument to
from . |
Constant |
preExtract
(¬ø) A Boolean or string value indicating how feature vectors are to be
pre-extracted; argument to
preExtract . |
int |
preExtractClauses
Counts the number of
preExtract clauses for error detection. |
Constant |
previousPruneCountType
(ø) The contents of
pruneCountType on the previous run of the compiler, if
any. |
Constant |
progressOutput
(ø) Integer specifying how often (in examples) to give the user a progress update
during training; argument to
progressOutput . |
int |
progressOutputClauses
Counts the number of
progressOutput clauses, for error detection. |
Constant |
pruneCountType
(ø) Whether to use "global" or "perClass" feature pruning.
|
Integer |
pruneStatus
The revision status of the LCE's prune node.
|
Constant |
pruneThreshold
(ø) The feature pruning threshold.
|
Constant |
pruneThresholdType
(ø) Whether to use "count" or "percent" counting for feature pruning.
|
Expression |
rounds
(ø) Represents the integer number of training repetitions; augments the
from clause. |
FoldParser.SplitPolicy |
splitPolicy
(ø) Dictates how the training data will be split into subsets for use by cross
validation; second argument to
cval . |
int |
startingRound
Training starts from this round number.
|
int |
testFromClauses
Counts the number of
testFrom clauses for error detection. |
InstanceCreationExpression |
testingMetric
(ø) Determines how the user wishes cross-validation to test its performance; argument
to
testingMetric . |
int |
testingMetricClauses
Counts the number of
testingMetric clauses, for error detection. |
InstanceCreationExpression |
testParser
(ø) Tells this learning classifier how to get its testing data; argument to
testFrom . |
int |
usingClauses
Counts the number of
using clauses for error detection. |
int |
withClauses
Counts the number of
with clauses for error detection. |
argument, cacheIn, comment, name, parenthesized, returnType, singleExampleCache
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
LearningClassifierExpression(ClassifierExpression l,
ClassifierExpression ext,
InstanceCreationExpression p,
Expression r,
InstanceCreationExpression a,
Name ln,
Block pb,
Constant enc,
InstanceCreationExpression tp,
Expression e,
Constant k,
LinkedList<ParameterSet> prms,
FoldParser.SplitPolicy s,
InstanceCreationExpression t,
Constant al,
Constant pre,
Constant pro,
Constant pct,
Constant ptt,
Constant pt,
Integer ls,
Integer fs,
Integer ps,
StringBuffer at,
boolean cdv)
Full constructor.
|
LearningClassifierExpression(ClassifierExpression l,
LinkedList<LearningClassifierExpression.Clause> cl,
int line,
int byteOffset)
Parser's supervised learning constructor.
|
LearningClassifierExpression(LinkedList<LearningClassifierExpression.Clause> cl,
int line,
int byteOffset)
Parser's unsupervised learning constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
int |
hashCode()
Returns a hash code value for java hash structures.
|
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
void |
runPass(Pass pass)
Ensures that the correct
run() method is called for this type of node. |
StringBuffer |
shallow()
Creates a
StringBuffer containing a shallow representation of this
ASTNode . |
void |
write(StringBuffer buffer)
Writes a string representation of this
ASTNode to the specified buffer. |
getLine, getName, setCacheIn
public static final InstanceCreationExpression defaultDiscreteLearner
public static final InstanceCreationExpression defaultRealLearner
public static final double defaultAlpha
alpha
clause appears during cross validation, this constant is used.public static final String defaultPreExtract
preExtract
clause appears in the sources, this constant is used.public Integer featuresStatus
public Integer pruneStatus
public Integer learningStatus
public boolean onlyCodeGeneration
true
iff the changes to the learner's LBJava specification
require its Java translation to be regenerated and nothing more.public ClassifierExpression labeler
public ClassifierExpression extractor
using
.public int usingClauses
using
clauses for error detection.public Constant featureEncoding
public int encodingClauses
encoding
clauses for error detection.public InstanceCreationExpression parser
from
.public int fromClauses
from
clauses for error detection.public Expression rounds
from
clause.public int startingRound
public Constant pruneCountType
public Constant pruneThresholdType
public Constant pruneThreshold
public Constant previousPruneCountType
pruneCountType
on the previous run of the compiler, if
any.public InstanceCreationExpression learnerConstructor
with
. This variable should not contain a non-null
value if
learnerName
and learnerParameterBlock
contain non-null
values.public Name learnerName
with
.
If this variable contains a non-null
value, learnerParameterBlock
must
also be non-null
, and learnerConstructor
must be null
.public Block learnerParameterBlock
with
. If this variable contains a non-null
value, learnerName
must also be non-null
, and
learnerConstructor
must be null
.public int withClauses
with
clauses for error detection.public InstanceCreationExpression testParser
testFrom
.public int testFromClauses
testFrom
clauses for error detection.public Expression evaluation
evaluate
.public int evaluateClauses
evaluate
clauses for error detection.public LinkedList<ParameterSet> parameterSets
ParameterSet
objects that appear in the argument list.public Constant K
cval
.public FoldParser.SplitPolicy splitPolicy
cval
.public int cvalClauses
cval
clauses for error detection.public InstanceCreationExpression testingMetric
testingMetric
.public int testingMetricClauses
testingMetric
clauses, for error detection.public Constant alpha
alpha
, which can only be specified when cval
is
also specified.public int alphaClauses
alpha
clauses, for error detection.public Constant preExtract
preExtract
. Possible values are false
,
true
, "false"
, "true"
, "none"
,
"memory"
, "disk"
, and "diskZip"
.public int preExtractClauses
preExtract
clauses for error detection.public Constant progressOutput
progressOutput
.public int progressOutputClauses
progressOutput
clauses, for error detection.public boolean checkDiscreteValues
SemanticAnalysis
pass will let this LearningClassifierExpression
know if the features it generates need to be checked for appropriateness in the context of
the enclosing ClassifierAssignment
by setting this flag.public StringBuffer attributeString
Its format follows this convention: "<type>_<name>[_<value-list>]:<type>_<name>[_<value-list>:[...]]"
<type> can be either "num", "str", or "nom", representing numerical, string, and nominal attributes respectively.
Numerical and string attribute encodings do not need a value-list, while Nominal attribute encodings are required to contain a value list. Examples:
public LearningClassifierExpression(ClassifierExpression l, ClassifierExpression ext, InstanceCreationExpression p, Expression r, InstanceCreationExpression a, Name ln, Block pb, Constant enc, InstanceCreationExpression tp, Expression e, Constant k, LinkedList<ParameterSet> prms, FoldParser.SplitPolicy s, InstanceCreationExpression t, Constant al, Constant pre, Constant pro, Constant pct, Constant ptt, Constant pt, Integer ls, Integer fs, Integer ps, StringBuffer at, boolean cdv)
l
- The expression representing the labeler classifier.ext
- Representation of the extractor classifier.p
- The expression representing the parser applied to data.r
- The constant representing the number of training repetitions.a
- A learning algorithm instance creation expression.ln
- The name of a learning algorithm.pb
- A block of statements used to set learning algorithm parameters.enc
- The expression representing the feature encoding used in this learner's lexicon.tp
- The expression representing the test parser.e
- The expression used to compute a prediction.k
- The number of folds for cross validation.prms
- The sets of parameter values used in tuning.s
- The method used to split the data for cross validation.t
- Determines how the user wishes cross-validation to test its performance.al
- The cross validation confidence interval width.pre
- A Boolean indicating whether example vectors will be pre-extracted.pro
- An integer indicating how often progress updates will be output.pct
- The prune type ("global" or "perClass").ptt
- The prune count type ("count" or "percent").pt
- The prune count threshold.ls
- The "learning status" node, set by RevisionAnalysis.fs
- The "features status" node, set by RevisionAnalysis.ps
- The "prune status" node, set by RevisionAnalysis.at
- The WEKA attribute string.cdv
- Value for checkDiscreteValues
.public LearningClassifierExpression(LinkedList<LearningClassifierExpression.Clause> cl, int line, int byteOffset)
cl
- A list of clauses.line
- The line on which the source code represented by this node is found.byteOffset
- The byte offset from the beginning of the source file at which the source
code represented by this node is found.public LearningClassifierExpression(ClassifierExpression l, LinkedList<LearningClassifierExpression.Clause> cl, int line, int byteOffset)
l
- The expression representing the labeler classifier.cl
- A list of clauses.line
- The line on which the source code represented by this node is found.byteOffset
- The byte offset from the beginning of the source file at which the source
code represented by this node is found.public int hashCode()
public boolean equals(Object o)
public ASTNodeIterator iterator()
public Object clone()
public void runPass(Pass pass)
run()
method is called for this type of node.public void write(StringBuffer buffer)
ASTNode
to the specified buffer. The
representation written is parsable by the LBJava compiler, but not very readable.public StringBuffer shallow()
StringBuffer
containing a shallow representation of this
ASTNode
.shallow
in interface CodeGenerator
shallow
in class ClassifierExpression
StringBuffer
containing a shallow text representation of the given
node.Copyright © 2016. All rights reserved.