496. U.S. Patent Phrase to Phrase Matching | us-patent-phrase-to-phrase-matching
感谢组织者和Kaggle举办了这么棒的比赛。同时也感谢大家在比赛期间的分享。我从讨论区和一些优秀的Notebook中学到了很多。
看看顶尖的解决方案,我的方案似乎非常简单 😅,它主要依赖于训练模型的多样性。
这套设置让我能够充分利用比赛期间有限的时间。我只需从命令行更改一些标志,就可以运行一系列实验。
我在比赛开始时花了很多时间制定可靠的CV策略。我尝试了公开Notebook和讨论中分享的所有策略,最终确定了按anchor分组并按score分层的策略,如下所示:
train_df["score_bin"] = pd.cut(train_df["score"], bins=5, labels=False)
train_df["fold"] = -1
sgkf = StratifiedGroupKFold(n_splits=n_folds, shuffle=True, random_state=seed)
folds = sgkf.split(
X=train_df,
y=train_df["score_bin"].to_numpy(),
groups=train_df["anchor"].to_numpy(),
)
for fold, (trn_idx, val_idx) in enumerate(folds):
train_df.loc[val_idx, "fold"] = fold
train_df["fold"] = train_df["fold"].astype(int)
[s] 代替 [SEP]。将基线模型的CV从 0.81408 提升到了 0.81906我使用了 Chris Deotte 在这里解释的爬山法。我在最终提交中使用了 0.0 的容差(即只要CV增加就添加新模型)。此外,我在集成时使用 MinMaxScaler 对所有模型的预测进行了缩放。
然而,我也选择了一个容差为 0.0003 的提交以避免在CV上过拟合,但结果发现容差为 0 的提交在Private LB上得分最高。