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
データ整形について
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
株式会社Curious Vehicle
February 28, 2025
9
0
Share
データ整形について
株式会社Curious Vehicle
February 28, 2025
More Decks by 株式会社Curious Vehicle
See All by 株式会社Curious Vehicle
PQCが変える暗号の世界
curicle
0
13
最近流行ってるClaudeについて
curicle
0
5
ElasticsearchのHA構成について
curicle
0
11
機械学習で絶対音感になりたかった
curicle
0
13
BQにおけるSQLアンチパターンとslot消費削減策
curicle
0
16
VibeKanbanについて
curicle
0
10
"バーチャル宮本さん"を作ってみた
curicle
0
8
"バーチャル宮本さん” 本番デプロイ編
curicle
0
14
最近課金しているAIサービスについて
curicle
0
15
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
100
BBQ
matthewcrist
89
10k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
100
Building a Scalable Design System with Sketch
lauravandoore
463
34k
First, design no harm
axbom
PRO
2
1.2k
The Invisible Side of Design
smashingmag
302
51k
Context Engineering - Making Every Token Count
addyosmani
9
790
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Odyssey Design
rkendrick25
PRO
2
560
Art, The Web, and Tiny UX
lynnandtonic
304
21k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
180
Transcript
第40回勉強会 データ解析まわり (1) 安齋 佑司 -- Curious Vehicle Confidential. --
1
もくじ 1. データ解析のフロー 2. デモの概要 3. 加工・整形の環境 4. CSVデータのロード 5.
trainとtestデータの作成 6. まとめ -- Curious Vehicle Confidential. -- 2
データ解析のフロー -- Curious Vehicle Confidential. -- 3 データ解析までの一般的な流れ
1. 収集 2. 選択 3. 加工・整形 4. 解析 • 本題の解析に至るまで のプロセスが長い • ここを速くできれば本 題の解析に使う工数が 増やせる
データ解析のフロー -- Curious Vehicle Confidential. -- 4 データ解析までの一般的な流れ
1. 収集 2. 選択 3. 加工・整形 4. 解析 • 環境や内容に依存する ためパターンは様々
データ解析のフロー -- Curious Vehicle Confidential. -- 5 データ解析までの一般的な流れ
1. 収集 2. 選択 3. 加工・整形 4. 解析 今回はここには触れません
データ解析のフロー -- Curious Vehicle Confidential. -- 6 データ解析までの一般的な流れ
1. 収集 2. 選択 3. 加工・整形 4. 解析 • プログラミングでここを 簡単に対応する方法を 紹介 • 一部解析も入ります
デモの概要 -- Curious Vehicle Confidential. -- 7 ワインの定量情報をもとに質を分類する
使用するデータ
デモの概要 -- Curious Vehicle Confidential. -- 8
デモの概要 -- Curious Vehicle Confidential. -- 9
デモの概要 -- Curious Vehicle Confidential. -- 10
加工・整形の環境 -- Curious Vehicle Confidential. -- 11 今回使用するライブラリ
(Python3) 加工・成形部分
加工・整形の環境 -- Curious Vehicle Confidential. -- 12 今回使用するライブラリ
(Python3) 分析部分
CSVデータのロード -- Curious Vehicle Confidential. -- 13 1行目のヘッダー行はスキップ
デリミターは “;” セミコロン (拡張子はcsvになっているが、、) データファイルから ndarray 形式のオブジェクトが作成される
trainとtestデータの作成 -- Curious Vehicle Confidential. -- 14 読み込んだデータの0から10のカラムは解析の素性として使う
12番目(配列の11) はラベルとして使用する (質を分類するため)
trainとtestデータの作成 -- Curious Vehicle Confidential. -- 15 今回は質を
8 以上、6以上7以下、6未満の3カテゴリに変更した ※ 質はだいたい正規分布になっているためボリュームを考慮した
trainとtestデータの作成 -- Curious Vehicle Confidential. -- 16 データの90%をtrainに10%をtestに設定
randomが毎回同じになるように seed を設定 この関数だけでtrainとtestの分析用データとラベルが作成される train のデータを使用して分類モデルを作成
trainとtestデータの作成 -- Curious Vehicle Confidential. -- 17 作成した分析モデルを使用してテストデータを予測する
正解ラベルと予測結果を比較して分類精度を出力する
まとめ -- Curious Vehicle Confidential. -- 18 • CSVデータのロードは
loadtxt 関数 • train と test データの作成部分は train_test_split 関数 • 面倒なデータ整形は便利なライブラリで解決 • ついでに機械学習と精度の出力もライブラリの関 数をつかって完了 • 余った時間をモデルの精度向上に充てよう
おしまい -- Curious Vehicle Confidential. -- 19 ご静聴ありがとうございました。