0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SIGNATE Cup 2024 結果報告レポート

Last updated at Posted at 2024-10-18

はじめに

今回はSIGNATE Cup 2024(SOTA Challenge)に参加したので記録として残しておきたいと思います。

最終結果

0.76 ※暫定評価(2024/10/18 時点)

振り返り

かなりの時間を使った前処理を完璧にやりきれなかったことが1番の反省点だと思います。
また、ハイパーパラメータチューニングにも時間を使えなかったのが残念でした。
一方で特徴量スケーリングの必要性に自身で気づけたこと,勾配降下法 ブースティング 決定木といった機械学習のアルゴリズムについて理解できたことは良かったなと感じた。

分析

ここからは具体的にどのような分析をしたか一部抜粋して紹介していきます。

前処理

まずは表記揺れやデータの乱れを無くして綺麗な状態にするところから始めました。

特徴量 処理
Age 値を数値のみに統一
DurationOfPitch 単位を全て"秒"に変換,値を数値のみに統一
Gender 全て小文字に統一,空白の削除
NumberOfTrips "年に〇回"表記の値を数値のみに統一
MonthlyIncome "月収〇万円"表記の値を数値のみに統一

この記事を書いているときに気づきましたが、Age53才20代といった表記の値に対応していない処理をしていたため欠損値が多くなってしまっていました。
他にもProductPitchedDesignationという特徴量のデータの乱れを解消することができず特徴量として使用できませんでした。この部分の前処理の甘さが1番の反省ポイントだったと思います。

特徴量スケーリング

DurationOfPitchの単位を"秒"で統一したため数値が大きくなり、他の特徴量とスケールが異なっていることに気づきました。スケールが異なると勾配降下法などの機械学習で学習が非効率になる原因となるため特徴量スケーリングを施しました。
最大値最小値が決まっていないことや外れ値が存在している可能性を考慮して正規化ではなく標準化をしました。
今回はscikit-learnStanderdScalarというクラスを使用しました。

特徴量スケーリング
from sklearn.preprocessing import StandardScaler

columns_to_standardize = [
    "Age", "DurationOfPitch", "NumberOfPersonVisiting",
    "NumberOfFollowups", "PreferredPropertyStar",
    "NumberOfTrips", "MonthlyIncome"
]

scaler = StandardScaler()

train_standardized = train.copy()
train_standardized[columns_to_standardize] = scaler.fit_transform(train[columns_to_standardize])

test_standardized = test.copy()
test_standardized[columns_to_standardize] = scaler.transform(test[columns_to_standardize])

欠損値処理

欠損値の存在は厄介だなと思い、欠損値を含む行を全て削除したら提出データの行数が減ってしまいSIGNATEでの評価がエラーとなってしまいました。
代替案として今回はKNNInputerというscikit-learnの機械学習を使用した欠損値処理をしました。

欠損値処理
from sklearn.impute import KNNImputer

imputer = KNNImputer(n_neighbors=5)

cols_to_impute = ['Age', 'DurationOfPitch', 'NumberOfFollowups', 'NumberOfTrips', 'MonthlyIncome']

train_numerical = train[cols_to_impute]
test_numerical = test[cols_to_impute]

train_filled_numerical = pd.DataFrame(imputer.fit_transform(train_numerical), columns=train_numerical.columns)
test_filled_numerical = pd.DataFrame(imputer.transform(test_numerical), columns=test_numerical.columns)

train[cols_to_impute] = train_filled_numerical
test[cols_to_impute] = test_filled_numerical

機械学習モデルの選定

今回はロジスティック回帰 XGboost catboostを使用しました。
結果はcatboostが1番良いスコアが出たので採用しました。

最後に

前処理の丁寧さや特徴量・機械学習モデルの選定、ハイパーパラメータチューニングなどまだまだ改善の余地があるなと感じました。成長した部分と反省点を踏まえて再び挑戦したいと思います!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?