当前位置: 首页>>代码示例>>Python>>正文


Python TestUtil.fork_process方法代码示例

本文整理汇总了Python中jubatus_test.test_util.TestUtil.fork_process方法的典型用法代码示例。如果您正苦于以下问题:Python TestUtil.fork_process方法的具体用法?Python TestUtil.fork_process怎么用?Python TestUtil.fork_process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jubatus_test.test_util.TestUtil的用法示例。


在下文中一共展示了TestUtil.fork_process方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from jubatus_test.test_util import TestUtil [as 别名]
# 或者: from jubatus_test.test_util.TestUtil import fork_process [as 别名]
    def setUp(self):
        self.config = {
            "method": "kmeans",
            "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"}],
            },
            "parameter": {"k": 10, "seed": 0},
            "compressor_method": "simple",
            "compressor_parameter": {"bucket_size": 3},
        }

        TestUtil.write_file("config_clustering.json", json.dumps(self.config))
        self.srv = TestUtil.fork_process("clustering", port, "config_clustering.json")
        try:
            self.cli = Clustering(host, port, "name")
        except:
            TestUtil.kill_process(self.srv)
            raise
开发者ID:jubatus,项目名称:jubatus-python-client,代码行数:27,代码来源:test.py

示例2: setUp

# 需要导入模块: from jubatus_test.test_util import TestUtil [as 别名]
# 或者: from jubatus_test.test_util.TestUtil import fork_process [as 别名]
    def setUp(self):
        self.config = {
            "method": "AROW",
            "converter": {
                "string_filter_types": {},
                "string_filter_rules": [],
                "num_filter_types": {},
                "num_filter_rules": [],
                "string_types": {},
                "string_rules": [],
                "num_types": {},
                "num_rules": []
                },
            "parameter": {
                "regularization_weight": 1.001
                }
            }

        TestUtil.write_file('config_for_error.json', json.dumps(self.config))
        self.srv = TestUtil.fork_process('classifier', port, 'config_for_error.json')
        try:
            address = msgpackrpc.Address(host, port)
            client = msgpackrpc.Client(address)
            self.cli = jubatus.common.Client(client, "name")
        except:
            TestUtil.kill_process(self.srv)
            raise
开发者ID:gwtnb,项目名称:jubatus-python-client,代码行数:29,代码来源:test.py

示例3: setUp

# 需要导入模块: from jubatus_test.test_util import TestUtil [as 别名]
# 或者: from jubatus_test.test_util.TestUtil import fork_process [as 别名]
  def setUp(self):
    self.config = {
     "method": "lof",
     "converter" : {
       "string_filter_types" : {},
       "string_filter_rules" : [],
       "num_filter_types" : {},
       "num_filter_rules" : [],
       "string_types" : {},
       "string_rules" : [{"key" : "*", "type" : "space", "sample_weight" : "bin", "global_weight" : "bin"}],
       "num_types" : {},
       "num_rules" : [{"key" : "*","type" : "num"}]
     },
     "parameter": {
       "nearest_neighbor_num": 10,
       "reverse_nearest_neighbor_num": 30,
       "method": "euclid_lsh",
       "parameter": {
         "lsh_num": 8,
         "table_num": 16,
         "probe_num": 64,
         "bin_width": 10.0,
         "seed": 1091,
         "retain_projection": False
       }
     }
    }

    TestUtil.write_file('config_anomaly.json', json.dumps(self.config))
    self.srv = TestUtil.fork_process('anomaly', port, 'config_anomaly.json')
    self.cli = anomaly(host, port)
开发者ID:TkrUdagawa,项目名称:jubatus-python-client,代码行数:33,代码来源:test.py

示例4: setUp

# 需要导入模块: from jubatus_test.test_util import TestUtil [as 别名]
# 或者: from jubatus_test.test_util.TestUtil import fork_process [as 别名]
 def setUp(self):
     self.srv = TestUtil.fork_process("regression", port)
     self.cli = regression(host, port)
     method = "PA"
     self.converter = '{\n"string_filter_types":{}, \n"string_filter_rules":[], \n"num_filter_types":{}, \n"num_filter_rules":[], \n"string_types":{}, \n"string_rules":\n[{"key":"*", "type":"space", \n"sample_weight":"bin", "global_weight":"bin"}\n], \n"num_types":{}, \n"num_rules":[\n{"key":"*", "type":"num"}\n]\n}'
     cd = config_data(method, self.converter)
     self.cli.set_config("name", cd)
开发者ID:unnonouno,项目名称:jubatus-python-client,代码行数:9,代码来源:test.py

示例5: setUp

# 需要导入模块: from jubatus_test.test_util import TestUtil [as 别名]
# 或者: from jubatus_test.test_util.TestUtil import fork_process [as 别名]
    def setUp(self):
        self.config = {
            "method" : "kmeans",
            "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" }
                    ]
                },
            "parameter" : {
                "k" : 10,
                "compressor_method" : "simple",
                "bucket_size" : 3,
                "compressed_bucket_size" : 2,
                "bicriteria_base_size" : 1,
                "bucket_length" : 2,
                "forgetting_factor" : 0,
                "forgetting_threshold" : 0.5,
                "seed": 0,
                } 
            }

        TestUtil.write_file('config_clustering.json', json.dumps(self.config))
        self.srv = TestUtil.fork_process('clustering', port, 'config_clustering.json')
        try:
            self.cli = Clustering(host, port, "name")
        except:
            TestUtil.kill_process(self.srv)
            raise
开发者ID:kmaehashi,项目名称:jubatus-python-client,代码行数:39,代码来源:test.py

示例6: setUp

# 需要导入模块: from jubatus_test.test_util import TestUtil [as 别名]
# 或者: from jubatus_test.test_util.TestUtil import fork_process [as 别名]
 def setUp(self):
   self.srv = TestUtil.fork_process("graph", port)
   self.cli = graph(host, port)
开发者ID:kumagi,项目名称:jubatus-python-client,代码行数:5,代码来源:test.py


注:本文中的jubatus_test.test_util.TestUtil.fork_process方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。