Classifier¶
In this section, we introduce a way to use jubaclassifier
through a Jubatus client.
Classifier is a module to classify given data. For example, you can use Classifier to detect spam e-mails.
Overview¶
Let’s use gender as a sample program using Classifier. This program classifies a person into male or female through the features of his/her hair style, height and clothes.
As a first step, the program updates the model of jubaclassifier
using the training data. A training data is a pair of a class (male or female) and features (hair style, height, clothes). After preparing some training data, the program makes jubaclassifier
learn them.
Next, the program analyzes the test data using model of jubaclassifier
. It prepares test data, and then jubaclassifier
classifies each of them into male or female using the learned model.
For example, if you give the feature data as following to jubaclassifier
, it will return “female”.
"hair" is "long"
"top" is "shirt"
"bottom" is "skirt"
"height" is 1.50
Scenario¶
The following is a typical flow of development using Jubatus Client:
- Sets a connection configuration to
jubaclassifier
- Setting the HOST, RPC port and the instance name of
jubaclassifier
.
- Sets a connection configuration to
- Prepare training data
- Make some pairs of classes and feature sets.
- Train the model using prepared data (update the model)
- Send the training data to
jubaclassifier
usingtrain
method.
- Prepare the test data
- Make a set of feature data.
- Classify the test data
- Send the test data to
jubaclassifier
usingclassify
method.
- Output the result
- Compare the score value of each class, and output the class of the highest score.