Skip to content

Instantly share code, notes, and snippets.

0.00283329
0
@TkrUdagawa
TkrUdagawa / bench.py
Created December 11, 2017 07:22
anomaly score fluctuation
import jubatus
from jubatus.common import Datum
import random
import time
cl = jubatus.Anomaly("localhost", 9199, "test", 0)
random.seed(1)
datum_list = []
datum_length = 100
@TkrUdagawa
TkrUdagawa / add_bulk_bench.py
Last active December 11, 2017 07:51
benchmark result
-*- coding:utf-8 -*-
import jubatus
from jubatus.common import Datum
import random
import time
cl = jubatus.Anomaly("localhost", 9199, "test", 0)
cl.clear()
@TkrUdagawa
TkrUdagawa / ml.txt
Last active October 30, 2017 08:53
ml
Hi, Jubatus guys.
We are glad to announce that Jubatus 1.0.6 is now available.
This release contains the following feature improvements and bug fixes.
* Recommender: Add new APIs which return similar points using a filtering condition. similar_row_from_{id,datum}_and_score returns points which have greater similarity score than user specified score. similar_row_from_{id,datum}_and_rate returns points which have N% highest similarity score of all. Note that updating clients library is necessary to use these APIs.
* Fix the problem that build fails on macOS High Sierra.
* Jubakit: Drop support for python 2.6.
{
"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"}
],
@TkrUdagawa
TkrUdagawa / jubaanomaly.py
Created August 9, 2017 07:02
jubakit anomaly
import subprocess
import time
import jubatus
from jubatus.common import Datum
cmd = "jubaanomaly"
juba = subprocess.Popen([cmd, "-f", "light_lof.json"])
time.sleep(5)
OutOfData Traceback (most recent call last)
<ipython-input-3-d4cacf0e18b0> in <module>()
18 m = JubaModel()
19 m = m.load_binary(open("/tmp/127.0.0.1_29179_classifier_iris.jubatus", "rb"))
---> 20 m = m.transform("nearest_neighbor")
21 # Stop the classifier.
22 classifier.stop()
/home/udagawa/work/jubakit/jubakit/jubakit/model.py in transform(self, service)
261 else:
@TkrUdagawa
TkrUdagawa / check_status.py
Last active June 22, 2017 07:12
get_config_test
import random
import time
import jubatus
from jubatus.common import Datum
def generate_data(num = 10, mu = 1.0, sigma = 1.0):
res = []
for i in range(num):
x = random.gauss(mu, sigma)
test: inverted_index_test.cpp
g++ -O2 -o test inverted_index_test.cpp `pkg-config jubatus-client --libs --cflags jubatus jubatus_core`
from jubatus.common import Datum
from jubatus.regression.client import Regression
import sys
import math
def read_file(filename):
with open(filename) as f:
return f.readlines()
def make_datum(line):