13th Place Solution
はじめに
まずはコンペを開催してくださった運営と,参加者の皆さんに感謝を申し上げます.
あまり参加できませんでしたが,何か参考になればと思ったのでsolutionを投稿します.
Solution
以下のコードで対戦データを各プレイヤーごとに分割して勝敗を予測した後,それらの予測結果をチームごとに集計して特徴量を作成しました.
teams_a = ["A1", "A2", "A3", "A4"]
teams_b = ["B1", "B2", "B3", "B4"]
player_columns = ["weapon", "rank", "level"]
common_columns = ["id", "period", "mode", "stage"]
train_player_a = [train[common_columns + [f"{team}-{col}" for col in player_columns] + ["y"]].rename(
columns={f"{team}-weapon": "weapon", f"{team}-rank": "rank", f"{team}-level": "level"}) for team in teams_a]
for df in train_player_a:
df["team"] = "A"
train["y"] = train["y"].replace({0: 1, 1: 0})
train_player_b = [train[common_columns + [f"{team}-{col}" for col in player_columns] + ["y"]].rename(
columns={f"{team}-weapon": "weapon", f"{team}-rank": "rank", f"{team}-level": "level"}) for team in teams_b]
for df in train_player_b:
df["team"] = "B"
train_player = pd.concat(train_player_a + train_player_b).reset_index(drop=True)
test_player_a = [test[common_columns + [f"{team}-{col}" for col in player_columns]].rename(
columns={f"{team}-weapon": "weapon", f"{team}-rank": "rank", f"{team}-level": "level"}) for team in teams_a]
for df in test_player_a:
df["team"] = "A"
test_player_b = [test[common_columns + [f"{team}-{col}" for col in player_columns]].rename(
columns={f"{team}-weapon": "weapon", f"{team}-rank": "rank", f"{team}-level": "level"}) for team in teams_b]
for df in test_player_b:
df["team"] = "B"
test_player = pd.concat(test_player_a + test_player_b).reset_index(drop=True)
特徴量
Playerごとのデータ
- 主にTarget Encodingを使用して特徴量を作成
- stageやmodeと他のカテゴリを組み合わせるなど
対戦データ
- Playerごとの勝敗の予測値の集計(mean, max min, std)
- チームA,Bの予測値の残差や範囲など
Model
- Playerごとのデータ
LightBGM: CV auc 0.53ぐらい
- 対戦データ
LightBGM: CV auc 0.59, accuracy 0.566ぐらい
Result
Public: 0.565138 Private: 0.562268
Public 15th -> Private 13th