Information Technology Reference
In-Depth Information
Figure 3. JGRIM: gridification process
Gridifying the k-NN Classifier
be accessed as getFile().read() . JGRIM
modifies the application code to include the
necessary instance variables and accessors.
Since this style is commonplace in Java, this
task often requires little or no effort.
3. Definition of internal and external interfaces.
Involves separating what a component does
from its implementation. Again, for the in-
ternal interfaces this is a common practice in
Java. For the external interfaces it involves
specifying the method signatures for either
using third-party services or exporting ap-
plication components as FSs.
4. Automatic assembling of the outputs of (2)
and (3) with metaservices. Basically, the
DI-enabled application code is injected with
JGRIM API classes by using the Spring DI
container (Walls and Breidenbach, 2005).
The resulting application is a reactive mobile
Grid service (MGS), a service capable of mi-
grating its execution based on environmental
conditions (Mateos et al., 2005) such as CPU
load, storage availability, network latency,
etc. More details on the JGRIM API and its
implementation can be found in (Mateos,
2008).
The k-NN algorithm (Dasarathy, 1991) is a popular
supervised learning technique for mining data.
k-NN is computationally intensive, hence it is a
suitable application for execution on a Grid. In the
next paragraphs, we will gridify it with JGRIM.
k-NN classifies instances by placing them at a
point of a multidimensional feature space. k-NN
first partitions the space into regions according
to class labels of several training samples, or
dataset. Then, it assigns the class C to a point if
C is the most frequent label among the k nearest
training samples.
Let us suppose that the existing implementation
of the k-NN algorithm consists of various helper
classes plus a KNN class with three operations:
classifyInstance : computes the label asso-
ciated to an instance.
classifyInstances : analogous to classifyIn-
stance but operates on a list of instances.
sameClass : tests whether two instances
have the same label.
One of the helper classes provides access to
a file-based dataset, which is accessed by these
methods. Basically, the structure of the applica-
tion code is:
The next section illustrates these steps through
the gridification of a concrete application.
Search WWH ::




Custom Search