目录
- 前言
- 将income 作为loss(优化目标)
- 多目标学习
- Topline整理
-
- AE+MLP (rank10)
- Current 17th solution: Ensembles of deep (49 layer) MLPs
- mixup augmentation: a way to learn from trades with weight=0 (rank4)
- My (perhaps) over-complicated LSTM solution
- Current 62nd place: Couple more tricks, and how I kinda sorta cheated
- Current 41st Place - Solution Overview & Code
前言
比赛链接:Jane Street Market Prediction
这里介绍几种比赛中使用到,但是最终提交没有用到的方法。
将income 作为loss(优化目标)
直接利用评价指标进行优化在不少比赛中都能取得很好的效果,但是对于不稳定的评价指标来说,训练过程可能会极不稳定,难以进行优化,因此无法取得很好的效果。
这里采取 交叉熵 训练,income 微调的方法。线下利用income 微调时可以获得比交叉熵训练更高的收益上限,但是过度微调仍会最终使得utility score下降。代码 框架参考了 这里 。
读取数据,定义优化目标
为了应用income作为优化目标,我们定义了y_train2 作为另一组标签。这里没有用utility score 作为优化目标的原因是,utility score需要以天为单位进行计算,这样的话,数据就没有进行充分shuffle。而且utility score十分不稳定,小batch训练可能效果可能很差。实际上,不进行shuffle和进行shuffle相比线上会带来不小的差距。shuffle后模型没办法学到天内的数据关系,但是抗噪性可能更强了,反而取得了更高的线上分数。
from tensorflow.keras.layers import Input, Dense, BatchNormalization, Dropout, Concatenate, Lambda, GaussianNoise, Activation
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.losses import BinaryCrossentropy
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers.experimental.preprocessing import Normalization
import tensorflow as tf
import numpy as np
import pandas as pd
from tqdm import tqdm
from random import choices
SEED = 1111
tf.random.set_seed(SEED)
np.random.seed(SEED)
train = pd.read_csv('../input/jane-street-market-prediction/train.csv')
train = train.query('date > 85').reset_index(drop = True)
train = train[train['weight'] != 0]
train.fillna(train.mean(),inplace=True)
train['action'] = ((train['resp'].values) > 0).astype(int)
features = [c for c in train.columns if "feature" in c]
f_mean = np.mean(train[features[1:]].values,axis=0)
resp_cols = ['resp_1', 'resp_2', 'resp_3', 'resp', 'resp_4']
X_train = train.loc[:, train.columns.str.contains('feature')]
y_train = np.stack([(train[c] > 0).astype('int') for c in resp_cols]