Skip to content

Instantly share code, notes, and snippets.

@taroyabuki
taroyabuki / makepdf.sh
Last active May 20, 2021
(ad hoc)『解釈可能な機械学習/Interpretable Machine Learning』日本語訳のPDF版を作る.(要Docker)
View makepdf.sh
# 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 Sep 4, 2020
日本の人口(1872--2017) 出典:日本統計年鑑 (1920年は国勢調査人口を採用)
View japan-population-1872-2017.csv
year population
1872 34806
1873 34985
1874 35154
1875 35316
1876 35555
1877 35870
1878 36166
1879 36464
1880 36649
View students-life.csv
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 / japan-prefectures.csv
Last active Jan 27, 2020
日本の都道府県(漢字,ローマ字)
View japan-prefectures.csv
北海道 Hokkaido
青森 Aomori
岩手 Iwate
宮城 Miyagi
秋田 Akita
山形 Yamagata
福島 Fukushima
茨城 Ibaraki
栃木 Tochigi
群馬 Gumma
View 2019-romaji-prefecture-min-wage.csv
Hokkaido 861
Aomori 790
Iwate 790
Miyagi 824
Akita 790
Yamagata 790
Fukushima 798
Ibaraki 849
Tochigi 853
Gumma 835
@taroyabuki
taroyabuki / 2019-kanji-prefecture-min-wage.csv
Last active Dec 6, 2019
2019年都道府県別最低賃金(県名がローマ字のデータ:https://gist.github.com/taroyabuki/3a95f24a7a84dafd030918dedb9485c1
View 2019-kanji-prefecture-min-wage.csv
北海道 861
青森 790
岩手 790
宮城 824
秋田 790
山形 790
福島 798
茨城 849
栃木 853
群馬 835
@taroyabuki
taroyabuki / VennDiagram.m
Created Dec 23, 2017
I rewrote the code published in http://mathworld.wolfram.com/VennDiagram.html to work with the latest version of Mathematica.
View VennDiagram.m
VennDiagram[n_, ineqs_: {}] := Module[{i, r = .6, R = 1, v, x, y, f},
v = Table[Circle[r {Cos[#], Sin[#]} &[2 Pi (i - 1)/n], R], {i, n}];
{
If[ineqs == {}, {},
f = And @@ (v /. Circle[{xx_, yy_}, rr_] :> (x - xx)^2 + (y - yy)^2 < rr^2)[[ineqs]];
RegionPlot[ImplicitRegion[f,
{x, y}], Axes -> False,
DisplayFunction -> Identity][[1]]
],
v
@taroyabuki
taroyabuki / 100weightchars.md
Last active Nov 9, 2017
Twitterで0.5文字とカウントされる文字の一覧(参考:https://developer.twitter.com/en/docs/developer-utilities/twitter-text
View 100weightchars.md

� � � � � � � � �

View four-coloring.m
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 / MyCos.java
Created Feb 9, 2016
(インテルCPUの)三角関数は不要 http://blog.unfindable.net/archives/8991
View MyCos.java
/*
<dependencies>
<dependency>
<groupId>org.apfloat</groupId>
<artifactId>apfloat</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
*/
import org.apfloat.*;