概要Pythonで機械学習をするときに使うscikit-learn(恐らく、サイキットラーンと呼びます)には前処理用のライブラリであるpreprocessingが組み込まれています。前処理とは、データの欠損保管や正規化、カテゴリデータの数値化等のことです。このpreprocessingの全メソッドの効果を検証したのが今回の記事です。irisのデータを題材にして説明していきます。 #preprocessingはspという名前で使うこととする import sklearn.preprocessing as sp #お決まりのライブラリをインポート import pandas as pd import numpy as np import matplotlib.pyplot as plt if __name__ == "__main__": #irisデータをdfに格納 df = pd.read
Feature scaling is a method used to normalize the range of independent variables or features of data. In data processing, it is also known as data normalization and is generally performed during the data preprocessing step. Since the range of values of raw data varies widely, in some machine learning algorithms, objective functions will not work properly without normalization. For example, many cl
Structured Data(構造化データ)の下処理をおこなう際に避けて通れないのがFeature Engineering(特徴量エンジニアリング)。 特に悩ましいのがカテゴリ変数の扱いで、どのように扱えば良いか困ることが多く、また、使った手法もすぐに忘れてしまいがちなので、自分なりに整理して記事にまとめておきたいというのが趣旨。 1.よく使われる手法 2.次元を増やさない場合 Label Encoding Count Encoding LabelCount (Count Rank) Encoding Target Encoding 3.次元を増やす場合 One hot encoding Entity Embedding 4.参考記事 1.よく使われる手法 まずはよく用いられる定番の手法から。次元を増やすかどうかで大まかに次の2つに分類できる。 ・次元を増やさない場合(Label, Co
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く