Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
qeMLパッケージの紹介
Search
bob3bob3
December 15, 2023
Science
0
1.8k
qeMLパッケージの紹介
caretやtidymodelsと同じような機械学習のラッパーqeMLパッケージの紹介
bob3bob3
December 15, 2023
Tweet
Share
More Decks by bob3bob3
See All by bob3bob3
RでPSM分析
bob3bob3
1
230
Rでコンジョイント分析 2024年版
bob3bob3
0
1.1k
『改訂新版前処理大全』の話と Apache Parquet の話 #TokyoR
bob3bob3
0
880
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
510
『データ可視化学入門』をPythonからRに翻訳した話(増強版)
bob3bob3
0
460
『データ可視化学入門』を PythonからRに翻訳した話
bob3bob3
1
540
「国と音楽」 ~spotifyrを用いて~ #muana
bob3bob3
2
530
パーマーステーションのペンギンたち#3 探索的データ分析(EDA)編
bob3bob3
1
650
Redditで遊ぼう #TokyoR 106
bob3bob3
0
690
Other Decks in Science
See All in Science
butterfly_effect/butterfly_effect_in-house
florets1
1
140
Reconciling Accuracy, Cost, and Latency of Inference Serving Systems
pjamshidi
0
120
ガウス過程回帰とベイズ最適化
nearme_tech
PRO
1
180
Introduction to Image Processing: 2.Frequ
hachama
0
470
LIMEを用いた判断根拠の可視化
kentaitakura
0
430
構造設計のための3D生成AI-最新の取り組みと今後の展開-
kojinishiguchi
0
860
Tensor Representations in Signal Processing and Machine Learning (Tutorial at APSIPA-ASC 2020)
yokotatsuya
0
110
02_西村訓弘_プログラムディレクター_人口減少を機にひらく未来社会.pdf
sip3ristex
0
120
MoveItを使った産業用ロボット向け動作作成方法の紹介 / Introduction to creating motion for industrial robots using MoveIt
ry0_ka
0
300
How were Quaternion discovered
kinakomoti321
2
1.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
130
Analysis-Ready Cloud-Optimized Data for your community and the entire world with Pangeo-Forge
jbusecke
0
130
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
A Tale of Four Properties
chriscoyier
158
23k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Why Our Code Smells
bkeepers
PRO
336
57k
Adopting Sorbet at Scale
ufuk
74
9.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Making Projects Easy
brettharned
116
6k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Code Reviewing Like a Champion
maltzj
521
39k
Faster Mobile Websites
deanohume
306
31k
Transcript
qeMLパッケージの紹介 R研究集会2023 (2023/12/16) @bob3bob3
qeMLパッケージとは? • caret、mlr3、tidymodelsと同じような、機械 学習に統一的なインターフェイスを提供する ラッパー。 • 「qe」は「quick and easy」。 •
とにかくシンプルで「 one liner」で機械学習を 事項できるのが売り。
作者 Norman Matloff The Art of R Programming (2011) の著者。
実行例 library(qeML) # メジャーリーガーのデータセット。ポジション、身長、体重、年齢 data(mlb1) # 体重を推定するモデル # 決定木、ランダムフォレスト、勾配ブースティング mlb1_rpart
<- mlb1 |> qeRpart("Weight") mlb1_rf <- mlb1 |> qeRFranger("Weight") mlb1_gb <- mlb1 |> qeGBoost("Weight")
実行例 # 推定 new_data <- data.frame(Position='Catcher', Height=73, Age=28) mlb1_rpart |>
predict(new_data) mlb1_rf |> predict(new_data) mlb1_gb |> predict(new_data) # これだけ! # 簡単だね!
Enjoy?
いやいや、まてまて • バリデーションは? • ハイパーパラメーターのチューニングは?
バリデーションは勝手にやってくれる # testデータでのMAE mlb1_rpart$testAcc mlb1_rf$testAcc mlb1_gb$testAcc data.frame( name = c("rpart",
"rf", "gb"), MAE = list(mlb1_rpart, mlb1_rf, mlb1_gb) |> map_dbl(\(x) pluck(x, "testAcc")) ) |> arrange(MAE) # name MAE # 1 rf 13.23741 # 2 gb 13.74169 # 3 rpart 14.24358
チューニングもできる # ランダムフォレストのグリッドサーチ例 qs_ft_rf <- mlb1 |> qeFT( "Weight", "qeRFranger",
pars = list(nTree= seq(100, 1000, 250), minNodeSize= seq(10, 30, 10)), nTst = 100, nXval = 10, showProgress=TRUE ) qs_ft_rf$outdf |> slice_min(meanAcc) # nTree minNodeSize meanAcc CI bonfCI # 1 350 10 8.326976 8.531146 8.653432
その他の機能 • 次元縮約、次元削減 • 並列化 • 欠損補完 • モデルの比較 •
Quick Start, ML Overviewなど親切なビネットがたくさん! • データセットも山盛り
……ただし • まだまだ開発中で発展途上。 • ドキュメントも書きかけという感じ。 • 実装されている手法がcaret、tidymodelsと比べるとまだ少ない。 • 実装が不完全な手法もある(xgboost, lightgbmなど)
• バリデーションの評価指標を変更ができない • Macだとインストールできないらしい(誰か検証して!)
Enjoy!