Class: Jubatus::Classifier::Client::Classifier

Inherits:
Jubatus::Common::ClientBase show all
Includes:
Jubatus::Common
Defined in:
lib/jubatus/classifier/client.rb

Instance Method Summary collapse

Methods included from Jubatus::Common

check_type, check_types

Methods inherited from Jubatus::Common::ClientBase

connect, #do_mix, #get_client, #get_config, #get_name, #get_proxy_status, #get_status, #load, #save, #set_name

Constructor Details

#initialize(host, port, name, timeout_sec = 10) ⇒ Classifier

Returns a new instance of Classifier.


16
17
18
# File 'lib/jubatus/classifier/client.rb', line 16

def initialize(host, port, name, timeout_sec=10)
  super
end

Instance Method Details

#classify(data) ⇒ Object


25
26
27
28
# File 'lib/jubatus/classifier/client.rb', line 25

def classify(data)
  @jubatus_client.call("classify", [data], TList.new(TList.new(TUserDef.new(
      EstimateResult))), [TList.new(TDatum.new)])
end

#clearObject


39
40
41
# File 'lib/jubatus/classifier/client.rb', line 39

def clear
  @jubatus_client.call("clear", [], TBool.new, [])
end

#delete_label(target_label) ⇒ Object


43
44
45
46
# File 'lib/jubatus/classifier/client.rb', line 43

def delete_label(target_label)
  @jubatus_client.call("delete_label", [target_label], TBool.new,
      [TString.new])
end

#get_labelsObject


30
31
32
33
# File 'lib/jubatus/classifier/client.rb', line 30

def get_labels
  @jubatus_client.call("get_labels", [], TMap.new(TString.new, TInt.new(false,
      8)), [])
end

#set_label(new_label) ⇒ Object


35
36
37
# File 'lib/jubatus/classifier/client.rb', line 35

def set_label(new_label)
  @jubatus_client.call("set_label", [new_label], TBool.new, [TString.new])
end

#train(data) ⇒ Object


20
21
22
23
# File 'lib/jubatus/classifier/client.rb', line 20

def train(data)
  @jubatus_client.call("train", [data], TInt.new(true, 4), [TList.new(
      TUserDef.new(LabeledDatum))])
end