Skip to content

Instantly share code, notes, and snippets.

View kozo2's full-sized avatar

Kozo Nishida kozo2

View GitHub Profile
[1] pry(main)> require 'numo/narray'
=> true
[2] pry(main)> z = Numo::Int32.new(3,10).rand(3)
=> Numo::Int32#shape=[3,10]
[[0, 0, 0, 1, 2, 0, 0, 1, 1, 2],
[2, 2, 1, 0, 2, 0, 0, 0, 1, 0],
[1, 1, 2, 1, 2, 0, 1, 2, 1, 0]]
[3] pry(main)> (~z.ne(0).any?(0)).any?
(pry):3: [BUG] fail cast from Fixnum to 1
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
@kozo2
kozo2 / sample4algobuilder.py
Created August 31, 2016 04:35
too simple KGML download script for Algobuilder
import glob
import re
import http.client
conn = http.client.HTTPConnection('rest.kegg.jp')
for i in glob.glob("./*.txt"):
content = open(i).read()
kegg_org_codes = re.findall('[a-x]{3}', content)
current directory: C:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rbczmq-1.7.9/ext/rbczmq
C:/msys64/mingw64/bin/ruby.exe -r ./siteconf20160902-9332-l42onj.rb extconf.rb
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
@kozo2
kozo2 / katsuojihack-sciruby.md
Created September 11, 2016 04:53
勝尾寺ハッカソンのネタリスト
@kozo2
kozo2 / config.fish
Last active September 24, 2016 08:53
fishshell config for osx
alias v /Applications/MacVim.app/Contents/MacOS/Vim
alias l "ls -al"
alias b brew
alias c code
alias o open
alias wh which
alias gp "git pull"
alias nicelog "git log --graph --decorate --all --oneline"
@kozo2
kozo2 / change_left_cmd_to_left_ctrl.json
Created September 22, 2016 12:42
Change cmd to ctrl
{
"profiles": [
{
"name": "Default profile",
"selected": true,
"simple_modifications": {
"left_command": "left_control"
}
}
]
@kozo2
kozo2 / thumb_control.json
Last active September 29, 2016 23:14
remap for thumb control
{
"profiles": [
{
"name": "Default profile",
"selected": true,
"simple_modifications": {
"left_command": "left_control",
"right_command": "right_control",
"left_option": "left_command",
"right_option": "right_command",

プロジェクトの詳細

概要

データサイエンスはここ数年で突如現れ世間の注目を集めている,最も人気があり利益を上げている技術分野である.しかし,この技術分野で用いられている2大プログラミング言語はRとPythonであり,Rubyは後塵を拝している.

 この原因は,Rubyの機械学習や数値計算・可視化のライブラリが,これらの言語に比べて未熟かつライブラリ間での連携が難しいという点にある.それに加え,インストール時のHow-Toや各ライブラリの詳細なドキュメント,「使ってみた」系のブログ記事などがあまり出回っていないという現状があり,Rubyでデータサイエンスを行うことのハードルを押し上げている.

 我々は「データ入力から解析,そして可視化までのワークフローのブラッシュアップ」を実現することにより前述の課題解決を狙っている.具体的にはRubyのライブラリを組み合わせ,どのようにデータの入力・解析・可視化を行えばよいかを示したマニュアルの作成を行う.またこれに伴い,不足機能の追加・不足ライブラリの作成・既存ライブラリのバグフィックスも適宜行いライブラリ間の連携もより簡単なものにする.これらが我々のプロジェクトの主たる目標である (Figure1).  また大前提の環境構築が入門者にとっての鬼門となっている現状から,Windows・Macで各種ライブラリをインストールするためのgem改善・マニュアル作成も行う.

 Rubyの科学技術計算系のライブラリ(SciRuby)は,総じて他の言語のそれに比べて未熟であるとはいえ,データフレームとその可視化・基礎的な統計解析のライブラリに限って言えば,実用可能なレベルには達している.本プロジェクト成功の暁には,これらのライブラリの使用方法を広め・データサイエンスにおけるRuby人口を増やし・開発へのフィードバックが増加する,といった好循環が期待できる.

@kozo2
kozo2 / jupyter4ubuntuonwin.sh
Last active October 28, 2016 14:17
a note for installing IRuby notebook to ubuntu on windows
shopt -s autocd
apt install libtool autoconf pkg-config g++ make unzip python-dev python3-dev
wget https://github.com/zeromq/libzmq/archive/master.zip
unzip master.zip
mv master.zip libzmq-master.zip
libzmq-master/
./autogen.sh
./configure
make
input_file = ARGV[0]
output_file = ARGV[1]
File.open(input_file, "r") do |filereader|
File.open(output_file, "w") do |filewriter|
header = filereader.readline
header = header.strip
header_list = header.split(",")
p header_list
filewriter.write(header_list.join(',')+"\n")