Skip to content

Instantly share code, notes, and snippets.

@taroyabuki
taroyabuki / makepdf.sh
Last active May 20, 2021 17:39
(ad hoc)『解釈可能な機械学習/Interpretable Machine Learning』日本語訳のPDF版を作る.(要Docker)
# usage:
# wget https://gist.githubusercontent.com/taroyabuki/ecb0da01ab85e0a0524383b97d17ae0f/raw/dc962ef5e8b13bfc2aa7b1bcea2edba7918cfd10/makepdf.sh
# docker run -it -e ROOT=TRUE -v $(pwd):/home/rstudio/work rocker/verse bash /home/rstudio/work/makepdf.sh
cd /home/rstudio/work
git clone -b japanese https://github.com/hacarus/interpretable-ml-book-ja.git
cd interpretable-ml-book-ja
@taroyabuki
taroyabuki / japan-population-1872-2017.csv
Last active September 4, 2020 13:53
日本の人口(1872--2017) 出典:日本統計年鑑 (1920年は国勢調査人口を採用)
year population
1872 34806
1873 34985
1874 35154
1875 35316
1876 35555
1877 35870
1878 36166
1879 36464
1880 36649
@taroyabuki
taroyabuki / japan-prefectures.csv
Last active January 27, 2020 15:52
日本の都道府県(漢字,ローマ字)
北海道 Hokkaido
青森 Aomori
岩手 Iwate
宮城 Miyagi
秋田 Akita
山形 Yamagata
福島 Fukushima
茨城 Ibaraki
栃木 Tochigi
群馬 Gumma
map = Import["http://mathforum.org/wagon/fall97/images/5colormap.gif"];
matrix = MorphologicalComponents[map];
vars = Flatten[Map[{p[#], q[#]} &, Rest[Union[Flatten[matrix]]]]];
f[r_] := Map[If[Length[Union[#]] > 2, Sort[Select[#, Positive]], Nothing] &,
Partition[r, 4, 1]];
neighbours = Union[Flatten[Map[f, Join[matrix, Transpose[matrix]]], 1]];
@taroyabuki
taroyabuki / students-life.csv
Created December 9, 2019 01:32
ある学生の生活
experiment weather lecture goout
T rainy F F
T sunny T T
T rainy T F
F rainy T F
F sunny T T
@taroyabuki
taroyabuki / 2019-kanji-prefecture-min-wage.csv
Last active December 6, 2019 08:02
2019年都道府県別最低賃金(県名がローマ字のデータ:https://gist.github.com/taroyabuki/3a95f24a7a84dafd030918dedb9485c1
北海道 861
青森 790
岩手 790
宮城 824
秋田 790
山形 790
福島 798
茨城 849
栃木 853
群馬 835
@taroyabuki
taroyabuki / 2019-romaji-prefecture-min-wage.csv
Created December 6, 2019 08:01
2019年都道府県別最低賃金(県名が漢字のデータ:https://gist.github.com/taroyabuki/39329ae29cbc95520e093d5c7fade6bb
Hokkaido 861
Aomori 790
Iwate 790
Miyagi 824
Akita 790
Yamagata 790
Fukushima 798
Ibaraki 849
Tochigi 853
Gumma 835
roll = 10;
surface[s_, t_] :=
RotationMatrix[s, {0, 0, 1}].{3 + t Cos[t]/(roll Pi), 0, t Sin[t]/(roll Pi)}
donut[t_] :=
ParametricPlot3D[surface[s, u], {s, 0, 2 Pi}, {u, 0, t},
Axes -> False, Boxed -> False, Mesh -> None, PlotPoints -> 40]
bugs[t_, n_] :=
@taroyabuki
taroyabuki / pythagoras3body.m
Last active July 11, 2019 13:52
ピタゴラス3体問題 (Burrau’s problem of three bodies) https://taroyabuki.github.io/2009/06/26/burraus-problem-of-three-bodies/
(*Mass*)
m = {3, 4, 5};
n = Length@m;
(*Coordination*)
p = Array[{Subscript[px, #][t], Subscript[py, #][t]} &, n];
q = Array[{Subscript[ x, #][t], Subscript[ y, #][t]} &, n];
initialCondition = {
p == {{0, 0}, { 0, 0}, {0, 0}},
@taroyabuki
taroyabuki / floyd.cpp
Created August 2, 2014 11:28
Toy problemsは役立たずか(Floydの問題・ネタバレ) http://blog.unfindable.net/archives/6103
//Are Toy Problems Useful?
//in Selected Papers on Computer Science by Knuth (p.172)
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <set>
#include <unordered_map> // faster than map
#include <algorithm>