Skip to content

Instantly share code, notes, and snippets.

View barusan's full-sized avatar

バル barusan

  • Tokyo/東京
View GitHub Profile
@barusan
barusan / iris_rf.py
Created February 28, 2018 13:13
2-class 2-D random forest sample with iris dataset
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import export_graphviz
export_dot = True
@barusan
barusan / iris_svm.py
Created February 28, 2018 13:05
2-class 2-D SVM sample with iris dataset
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.svm import LinearSVC
iris = load_iris()
mask = iris.target != 2
@barusan
barusan / result.md
Last active January 5, 2018 14:42
UnixBench w/ and w/o KPTI

Conditions

  • BYTE UNIX Benchmarks (Version 5.1.3)
  • OS: Debian stretch
    • w/o KPTI: GNU/Linux -- 4.9.0-4-amd64 -- #1 SMP Debian 4.9.65-3 (2017-12-03)
    • w/ KPTI: GNU/Linux -- 4.9.0-5-amd64 -- #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04)
  • Machine: x86_64: unknown
  • Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
  • CPUs: Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz x 2
  • Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
@barusan
barusan / autoplait_wrapper.py
Last active September 25, 2017 14:25
Python3 wrapper for autoplait
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
Python3 wrapper for Autoplait
=============================
Original:
Yasuko Matsubara, Yasushi Sakurai, Christos Faloutsos,
"AutoPlait: Automatic Mining of Co-evolving Time Sequences",
@barusan
barusan / requirements.md
Last active April 26, 2017 10:38
Greenplum Prerequisites for Debian 8 (jessie)
$ sudo apt-get install build-essential libperl-dev libpython-dev libreadline-dev libxml2-dev \
    zlib1g-dev libapr1-dev libevent-dev libcurl4-openssl-dev libbz2-dev libyaml-dev bison flex \

python-psutil python-lockfile python-paramiko python-setuptools python-epydoc

@barusan
barusan / jmadata.py
Created May 11, 2016 09:58
気象庁 過去の気象データ CSV
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
気象庁から過去の気象データを CSV 形式でダウンロードする。
API が提供されていないので、ウェブページを参考にスクリプトを作成した。
http://www.data.jma.go.jp/gmd/risk/obsdl/index.php
とりあえず時別値のダウンロードのみ対応。
@barusan
barusan / gaussian_mle.r
Created April 3, 2016 07:58
experiment of unbiased variance over normally-distributed data
#!/usr/local/bin/Rscript
# run on Mac OS X, homebrew R
library(ggplot2)
# sample sizes
sizes <- c(2, 5, 10, 20, 50, 100, 200, 500, 1000)
# return (x - 1) / x
ratio <- function(x) { (x - 1) / x }
@barusan
barusan / gaussian_mle.py
Last active April 20, 2016 10:14
experiment of unbiased variance over normally-distributed data
#!/usr/bin/env python2
#-*- coding: utf-8 -*-
import math
import numpy as np
import matplotlib.pyplot as plt
MEAN = 0.0
VARIANCE = 1.0
NTRIAL = 1000
@barusan
barusan / fitting.py
Created March 22, 2016 03:57
Polynomial curve fitting example
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Polynomial curve fitting example
import sys
import math
import itertools
import numpy as np
import numpy.random as rand
@barusan
barusan / pdftk-2.02-Makefile-Base.patch
Created October 6, 2015 11:41
$ diff -U1 Makefile.Base{.bak,}
--- Makefile.Base.bak 2015-10-06 20:31:18.000000000 +0900
+++ Makefile.Base 2015-10-06 20:37:07.000000000 +0900
@@ -30,5 +30,5 @@
-all : javalib pdftk
+all : pdftk
-javalib :
+$(JAVALIB) :
$(MAKE) -f Makefile -iC $(JAVALIBPATH) all