Database Reference
In-Depth Information
Before we explain the learning and application method of an agent, we mention
that we distinguish between stateless and stateful agents. A stateless agent, in
contrast to a stateful one, does only store some specific agent parameters
representing the rules, not the input data. This means the agent does not know its
current state and makes its decisions independent of his state. On the contrary, a
stateful agent knows its “history.” In general, stateful agents are easier to imple-
ment and to integrate. However, stateless agents support multithreading environ-
ments. For example, a recommendation agent working in real time is requested by
events of different sessions in a mixed order.
Now we turn to the learning step. If the agent is stateful, the method
addData
with a mining vector or a mining input stream as argument is used to add training
data to the agent. Each time
addData
is called, its data is added to the internal input
data vector of the agent. The method
clearData
removes all input data from the
vector. The method
learn
runs the (adaptive) learning based on the input data. There
are two other
learn
methods with a mining vector or a mining input stream as
argument, respectively. These methods, which can be applied to both stateful and
stateless agents, use only the data passed as argument for learning.
For application,
Agent
provides two
apply
methods, both applicable for stateful
and stateless agents. The first takes a mining vector as argument and returns an
action, specified by a generic (of the
Agent
class). In case of scoring, this may be
a Double or Integer, but an action may also have a more complex object like a
recommendation. The second
apply
method receives a mining input stream as
argument and returns a list of the generics representing the actions corresponding
to each mining vector of the mining input stream.
To combine learning and application in one step, there exist
learnApply
methods. Within these methods, both stateful and stateless agents use the input
miningInputStream
/
miningVector
for learning and application.
By means of this simple set of learning and application methods, a wide variety
of realtime learning scenarios can be covered. Note that depending on the imple-
mentation of a specific agent, not all of these methods must be supported.
Like
MiningAlgorithm
, also
Agent
owns a
verify
method which checks all
parameters of the agent class for correctness and completeness. Similar to
MiningModel
,
Agent
has a variable
function
to specify its basic agent type but no
variable similar to
algorithm
because each agent is usually enough specific, and so
clustering of agents on algorithm level does not make sense.
12.2.1.2 Agent Settings
AgentSettings
contains the general parameters of an agent and is very similar
in nature to
MiningSettings
. It also contains a reference to the agent and the
metadata of the learning/application data. Moreover,
Agent
owns a
verifySettings
method which checks all parameters of the settings class for correctness and
completeness.