SlideShare a Scribd company logo
1 of 9
kaggle入門(テーブルコンペ偏)
初心者の見るべき
Notebookの探し方
前置き
kaggleを初めてみたいけどうまく行かない人は多いと思います。
● Notebook(kernel)をまずはforkしてsubmmitしてみようとしたけど、読
めない。
● どのNotebookを参考にしたらいいかわからない
● やってみたけれど、どのあたりが訓練でどのあたりが予測なのかわか
らない
● そもそもよく見ると訓練しておらず、意味がわからない
そうならないようにするための工夫をまとめました。
※テーブルコンペを前提にまとめました
kaggleをスタートするために
目次
● コンペ開始直後で評価の高いNotebookを利用する
● 前処理→訓練→予測のステップを踏んでいるか確認する
● inputに注目する
● ML自体が初心者なら、LightGBMとXGBoost
● 提出まで出来たらEDAも見てみる
コンペ開始直後で
評価の高いNotebookを利用する
コンペ開始直後はシンプルで基礎的な手法のNotebookが多い
コンペ開始直後は序盤ということもあり簡素なNotebookがあげられます。後半になってくると積
極的にアンサンブルやスタッキングやpseudo labelingなど高度な技術が用いたNotebookが上がっ
てくる傾向があります。
初心者であればできるだけシンプルなコードを参考にして始めた方が、コンペ(データ)の意義
や全体像が掴めるため、おすすめです。
特に「Starter」と記載のあるNotebookを選択するのも良いです。
前処理→訓練→予測のステップを踏ん
でいるか確認する
全てのNotebookが上記ステップを踏んでいるとは限らない
全てのNotebookが前処理→訓練→予測まで一気通貫で書いているかというと、
そうではありません。
提出用のcsvをかき集めてアンサンブルしたものや、モデルがすでに作成済みで予測だけ実行する
Notebookもあります。それらはアンサンブル手法に工夫があったりGPU使用時間を短縮したりす
る目的がありますが、初心者にとって混乱することもあります。以下は前処理→訓練→予測の教
師あり学習の定番ステップを踏んでいるかどうか見極めるための私なりのコツです。
前処理
訓練
予測
データの加工は多くのテーブルコンペでは必須で、欠損値・外れ値・ノ
イズなどを処理します。pandasで数値や文字列を扱う処理、欠損処理、
apply(lambda..., fillna()などコードが確認できたり、xx_features,
xx_scaling, などわかりやすい関数名が付けられていたりします。
訓練が行われているか見極めるのは、train, fitなど学習時によく使われる
メソッドが実行されているか見ます。Notebookの序盤の方でimportされ
ているライブラリがLightGBM, torch, Keras…など何を利用しているのか
確認し、そのライブラリの学習メソッドが実行されているか注目します
submission.to_csv(“submission.csv)という記述があります。変数名とフ
ァイル名は異なるかもしれません。(初心者であればまずはsubmitして
みて、kaggleが何なのか掴むべきだと思ったので「予測」を項目に入れ
ましたが、EDAなどのNotebookも非常に重要です^^)
inputに注目する
inputがたくさんあるということは多くの工夫が凝縮されている
inputはNotebookが利用するファイルです。ここに多くのデータ入っている場合は初心者には向い
ていない可能性が高いです。
ここにはまず、コンペで利用するデータセットは入っています。それは特に問題ありません。
その他にどんなファイルが入ってくるかというと、学習済みモデル・ノイズ除去済みのデータセ
ット・Notebookの著者がよく使う独自関数などです。
これらは学習までに使う様々な工夫や知見を簡単に利用できてしまうため、初心者にとって
学びのチャンスロスになってしまい
ます。もちろんそのデータソースの
生成方法に関する別建てのNotebook
に辿り着いて読み込んだり、著者の
使う独自関数(※)を読み込めば問
題ありませんが、初心者には少しハ
ードルが高いかもしれません。
※独自関数は汎用性が低く可読性も
低いこともあるので、無理に読み込
みすぎないほういいです。
※ノイズ除去済みのデータ・学習済
みデータは、コンペにおいてスタン
ダードになっているケースもありま
すので、その場合は利用していきま
ML自体が初心者なら、LightGBMと
XGBoost
初心者に使いやすいGBDT
Machine Learning自体が初心者なのであればLightGBMやXGBoostなど
GBDT(勾配ブースティング決定木)の技術を用いたライブラリを使用することをお勧めします。
理由として以下の様なものが挙げられます。
● データによってはニューラルネットワークにも劣らない十分な精度を発揮する
● 正規化が不要。欠損値があっても学習が可能
● GPUを使用しないため、Kaggleの週のGPU使用時間制限を気にせずに学べる
● ハイパーパラメータの調整がわかりやすい
結論として理解しやすく使いやすいライブラリです。(CatBoostやNGBoostなど新しいGBDTライ
ブラリも登場していますが、
LightGBMとXGBoostは日本語の記事
も多くおすすめです)
提出まで出来たらEDAも見てみる
データみることで理解を深めるEDA
kaggleのコンペでいい成績を出す上で、データの理解は欠かせません。
そんな時重要なのがEDA(Explanatory Data Analysis)です。
データを可視化する上で使える手法は様々ですが、kagglerの上位陣のEDAは一人では思いつかな
い様な手法・切り口でデータの特徴を抽出していきます。
データを理解する上で参考にしながら、その手法を学ぶことができます。
おまけ:難しい(癖のある)
コンペの特徴
アウトプットが複雑
人気がない
LBとLocal CVの相関が弱い
画像(特に物体検出)や自然言語処
理はML初心者なら後回しでもいい
(当然挑んでもいい)
簡単な例 複雑な例
M5 Accuracyなどはクローズ前はLBが0で貼り
付いてしまっていました。
正しい精度を検証するための工夫を上位陣は行
っていましたが初心者だと難しいです。
タイタニックの様な生き残り分類や、土地価格
予想の様な金額推定に比べて画像と自然減処理
は難しい傾向にあります。
それは画像コンペで多用されるCNNや、言語で
利用されるRNNは全てNNの延長上の技術だか
らです。NNを理解していく上で一つ先のステ
ップになります。

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

初心者のみるべきNotebookの探し方