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
株式会社Curious Vehicle
February 28, 2025
0
7
データ整形について
株式会社Curious Vehicle
February 28, 2025
Tweet
Share
More Decks by 株式会社Curious Vehicle
See All by 株式会社Curious Vehicle
ElasticsearchのHA構成について
curicle
0
8
機械学習で絶対音感になりたかった
curicle
0
5
BQにおけるSQLアンチパターンとslot消費削減策
curicle
0
12
VibeKanbanについて
curicle
0
6
"バーチャル宮本さん"を作ってみた
curicle
0
6
"バーチャル宮本さん” 本番デプロイ編
curicle
0
11
最近課金しているAIサービスについて
curicle
0
12
Pub_Sub
curicle
0
5
音声認識について
curicle
0
9
Featured
See All Featured
sira's awesome portfolio website redesign presentation
elsirapls
0
150
Measuring & Analyzing Core Web Vitals
bluesmoon
9
760
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Bash Introduction
62gerente
615
210k
A better future with KSS
kneath
240
18k
Become a Pro
speakerdeck
PRO
31
5.8k
What's in a price? How to price your products and services
michaelherold
247
13k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
94
Done Done
chrislema
186
16k
Claude Code のすすめ
schroneko
67
210k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
93
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 ご静聴ありがとうございました。