jubaclassifier gender について

79 views
Skip to first unread message

咲希

unread,
Dec 13, 2016, 4:43:49 AM12/13/16
to Jubatus
加藤です。


jubatus についての勉強しています。

jubaclassifier gender を起動したいですが上手く行きません。

jubaclassifier --configpath  --configpath /path/to/jubatus/share/jubatus/example/config/classifier/perceptron.json &を入力すると下記のエラーが出てきます。


[root@localhost shogun]# cd ..
[root@localhost jubatus-example-master]# ls
README.md               network_intrusion_detection  train_route
gender                  npb_similar_player           trivial_burst
iris                    rent                         trivial_stat
language_detection      shogun                       twitter_streaming_lang
malware_classification  slot                         twitter_streaming_location
movielens               test                         winequality
[root@localhost jubatus-example-master]#  cd gender
[root@localhost gender]# ls
README.rst  cpp  gender.json  java  python  ruby
[root@localhost gender]# gender
bash: gender: コマンドが見つかりませんでした...
[root@localhost gender]# jubaclassifier --configpath /path/to/jubatus/share/jubatus/example/config/classifier/perceptron.json &
[2] 30672
[root@localhost gender]# 2016-12-13 18:21:22,496 30672 FATAL [server_util.hpp:146] exception in main thread: Dynamic exception type: jubatus::core::common::exception::runtime_error::what: Failed to get realpath
    #0 [jubatus::core::common::exception::error_api_func_*] = realpath
    #0 [jubatus::core::common::exception::error_file_name_*] = /path/to/jubatus/share/jubatus/example/config/classifier/perceptron.json
    #0 [jubatus::core::common::exception::error_errno_*] = No such file or directory (2)
    #0 [jubatus::core::common::exception::error_at_file_*] = ../jubatus/server/common/filesystem.cpp
    #0 [jubatus::core::common::exception::error_at_line_*] = 67
    #0 [jubatus::core::common::exception::error_at_func_*] = std::string jubatus::server::common::real_path(const string&)

エラーが出ないようにどうすればよいでしょうか。

お手数をおかけしますが、ご回答を宜しくお願いいたします。

Kenichi Maehashi

unread,
Dec 15, 2016, 3:38:14 AM12/15/16
to jub...@googlegroups.com
加藤さま

Jubatus Team の前橋です。

--configpath オプションには、Jubatusサーバの設定ファイルのパスを指定します。
サンプルの--configpathは指定例ですので、環境に合わせて読み替えてください。

genderサンプルの場合は、genderディレクトリにあるgender.jsonを指定してください。

よろしくお願いいたします。
> --
> You received this message because you are subscribed to the Google Groups
> "Jubatus" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jubatus+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Kenichi Maehashi @ Jubatus Team

咲希

unread,
Dec 15, 2016, 8:43:07 AM12/15/16
to Jubatus
前橋 様
教えて頂いて、ありがとうございました。
Message has been deleted
Message has been deleted
Message has been deleted

咲希

unread,
Dec 23, 2016, 2:56:08 AM12/23/16
to Jubatus
度々、すいません。
genderのプログラムを改造しましたが、下記のようにfemaleとmaleが出ないようにする方法ありますか。
プログラムの変更後、写真を載せています。gender.jsonと関係しているでしょうか。

実行の画面
[root@localhost python]# python ocho.py
female: -0.466667
Positive: 0.548655
Negative: 0.036522
male: -0.354240
female: -0.466667
Positive: -0.393080
Negative: 0.978257
male: -0.354240

お手数をおかけしますが、ご回答を宜しくお願いいたします。


 


Kenichi Maehashi

unread,
Dec 26, 2016, 9:44:41 PM12/26/16
to jub...@googlegroups.com
加藤さま

Jubatus Team の前橋です。

female/maleラベルのデータを学習した状態で、続けてPositive/Negativeラベルの学習を行うと、そのような状態になります。
別の学習モデルを構築したい場合は一旦学習モデルをクリアする必要があります。
学習モデルをクリアするには以下のいずれかを行ってください。

1) clear RPCを実行する。

>>> client.clear()

2) サーバプロセス(jubaclassifier)を再起動する。

よろしくお願い致します。

2016年12月23日 16:56 咲希 <chah...@gmail.com>:

--
You received this message because you are subscribed to the Google Groups "Jubatus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jubatus+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

咲希

unread,
Dec 26, 2016, 11:56:44 PM12/26/16
to Jubatus
ご返事ありがとうございました。

初心者な質問で申し訳ないですが、どのように client.clear()を使えますか。
下記のように実行しましたが、female/maleが消えません。


[root@localhost jubatus-example-master]# cd gender
[root@localhost gender]# cd python
[root@localhost python]# ls
ocho.py
[root@localhost python]# client.clear()
> ocho.py
bash: 予期しないトークン `ocho.py' 周辺に構文エラーがあります
[root@localhost python]# client.clear (ocho.py)
bash: 予期しないトークン `ocho.py' 周辺に構文エラーがあります
[root@localhost python]# client.clear ocho.py
bash: client.clear: コマンドが見つかりませんでした...
[root@localhost python]# python ocho.py
female: -0.466667
Positive: 0.759173
Negative: -0.176775
male: -0.390293
female: -0.466667
Positive: -0.198241
Negative: 0.780639
male: -0.390293
[root@localhost python]# 

サーバーの再起動
[root@localhost python]#  jubaclassifier --configpath /usr/share/jubatus/example/config/classifier/perceptron.json &
[1] 29377
[root@localhost python]# 2016-12-27 13:41:38,074 29377 INFO  [server_util.cpp:429] starting jubaclassifier 1.0.0 RPC server at 10.2.82.204:9199
    pid                  : 29377
    user                 : root
    mode                 : standalone mode
    timeout              : 10
    thread               : 2
    datadir              : /tmp
    logdir               : 
    log config           : 
    zookeeper            : 
    name                 : 
    interval sec         : 16
    interval count       : 512
    zookeeper timeout    : 10
    interconnect timeout : 10

2016-12-27 13:41:38,075 29377 INFO  [server_util.cpp:165] load config from local file: /usr/share/jubatus/example/config/classifier/perceptron.json
2016-12-27 13:41:38,075 29377 INFO  [classifier_serv.cpp:115] config loaded: {
  "converter" : {
    "string_filter_types" : {},
    "string_filter_rules" : [],
    "num_filter_types" : {},
    "num_filter_rules" : [],
    "string_types" : {},
    "string_rules" : [
      { "key" : "*", "type" : "str", "sample_weight" : "bin", "global_weight" : "bin" }
    ],
    "num_types" : {},
    "num_rules" : [
      { "key" : "*", "type" : "num" }
    ]
  },
  "method" : "perceptron"
}

2016-12-27 13:41:38,076 29377 FATAL [server_helper.hpp:251] server failed to start: any process using port 9199?
[root@localhost python]#  jubaclassifier --configpath /usr/share/jubatus/example/config/classifier/perceptron.json &
[2] 29516
[1]   中止                  (コアダンプ) jubaclassifier --configpath /usr/share/jubatus/example/config/classifier/perceptron.json
[root@localhost python]# 2016-12-27 13:51:54,948 29516 INFO  [server_util.cpp:429] starting jubaclassifier 1.0.0 RPC server at 10.2.82.204:9199
    pid                  : 29516
    user                 : root
    mode                 : standalone mode
    timeout              : 10
    thread               : 2
    datadir              : /tmp
    logdir               : 
    log config           : 
    zookeeper            : 
    name                 : 
    interval sec         : 16
    interval count       : 512
    zookeeper timeout    : 10
    interconnect timeout : 10

2016-12-27 13:51:54,949 29516 INFO  [server_util.cpp:165] load config from local file: /usr/share/jubatus/example/config/classifier/perceptron.json
2016-12-27 13:51:54,950 29516 INFO  [classifier_serv.cpp:115] config loaded: {
  "converter" : {
    "string_filter_types" : {},
    "string_filter_rules" : [],
    "num_filter_types" : {},
    "num_filter_rules" : [],
    "string_types" : {},
    "string_rules" : [
      { "key" : "*", "type" : "str", "sample_weight" : "bin", "global_weight" : "bin" }
    ],
    "num_types" : {},
    "num_rules" : [
      { "key" : "*", "type" : "num" }
    ]
  },
  "method" : "perceptron"
}

2016-12-27 13:51:54,950 29516 FATAL [server_helper.hpp:251] server failed to start: any process using port 9199?

お手数ですが、ご返事をいただければ幸いです。

Kenichi Maehashi

unread,
Jan 4, 2017, 11:48:42 PM1/4/17
to jub...@googlegroups.com
加藤さま

Jubatus Team の前橋です。

> どのように client.clear()を使えますか。

以下のようにコードに client.clear() を追加してください。

>> client = jubatus.Classifier(host, port, name)
>> client.clear()

よろしくお願い致します。
> --
> You received this message because you are subscribed to the Google Groups
> "Jubatus" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jubatus+u...@googlegroups.com.

咲希

unread,
Jan 11, 2017, 9:45:11 AM1/11/17
to Jubatus
ご回答ありがとうございました。 
Reply all
Reply to author
Forward
0 new messages