Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
2
機械学習で絶対音感になりたかった
curicle
0
5
BQにおけるSQLアンチパターンとslot消費削減策
curicle
0
10
VibeKanbanについて
curicle
0
5
"バーチャル宮本さん"を作ってみた
curicle
0
5
"バーチャル宮本さん” 本番デプロイ編
curicle
0
7
最近課金しているAIサービスについて
curicle
0
11
Pub_Sub
curicle
0
4
音声認識について
curicle
0
7
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Producing Creativity
orderedlist
PRO
348
40k
How STYLIGHT went responsive
nonsquared
100
5.9k
Become a Pro
speakerdeck
PRO
31
5.7k
Designing for humans not robots
tammielis
254
26k
Side Projects
sachag
455
43k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
KATA
mclloyd
PRO
32
15k
Thoughts on Productivity
jonyablonski
73
5k
GraphQLとの向き合い方2022年版
quramy
50
14k
Rails Girls Zürich Keynote
gr2m
95
14k
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 ご静聴ありがとうございました。