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.2k
qeMLパッケージの紹介
caretやtidymodelsと同じような機械学習のラッパーqeMLパッケージの紹介
bob3bob3
December 15, 2023
Tweet
Share
More Decks by bob3bob3
See All by bob3bob3
Rでコンジョイント分析 2024年版
bob3bob3
0
300
『改訂新版前処理大全』の話と Apache Parquet の話 #TokyoR
bob3bob3
0
210
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
380
『データ可視化学入門』をPythonからRに翻訳した話(増強版)
bob3bob3
0
360
『データ可視化学入門』を PythonからRに翻訳した話
bob3bob3
1
430
「国と音楽」 ~spotifyrを用いて~ #muana
bob3bob3
2
390
パーマーステーションのペンギンたち#3 探索的データ分析(EDA)編
bob3bob3
1
520
Redditで遊ぼう #TokyoR 106
bob3bob3
0
580
シン・初心者のためのR-Tips
bob3bob3
0
400
Other Decks in Science
See All in Science
Mechanistic Interpretability の紹介
sohtakahashi
0
160
Raccoon Roundworm
uni_of_nomi
0
110
Survival Under Fire: How to Stay Whole During Adversity
arthurdoler
PRO
0
120
ICRA2024 速報
rpc
3
4.4k
All-in-One Bioinformatics Platform Realized with Snowflake ~ From In Silico Drug Discovery, Disease Variant Analysis, to Single-Cell RNA-seq
ktatsuya
0
120
山形とさくらんぼに関するレクチャー(YG-900)
07jp27
1
160
Transformer系機械学習モデルを取り巻くライブラリや用語を整理する
bobfromjapan
2
580
様々な侵入者タイプに対応した適切な警備計画の策定 / Patrol route design considering various types of intrudes
konakalab
0
120
プロダクト開発を通して学んだナレッジマネジメントの哲学
sonod
0
110
早わかり W3C Community Group
takanorip
0
330
Celebrate UTIG: Staff and Student Awards 2024
utig
0
200
ultraArmをモニター提供してもらった話
miura55
0
150
Featured
See All Featured
It's Worth the Effort
3n
181
27k
Become a Pro
speakerdeck
PRO
15
4.8k
Design by the Numbers
sachag
277
18k
Building Adaptive Systems
keathley
34
2k
The Brand Is Dead. Long Live the Brand.
mthomps
52
36k
Bash Introduction
62gerente
607
210k
A designer walks into a library…
pauljervisheath
201
24k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
18
1.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.8k
Writing Fast Ruby
sferik
623
60k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
23
1.9k
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!