kaggle比赛链接:
https://www.kaggle.com/competitions/instant-gratification/data
普通方案
# 数据集路径
INPUT_PATH = '../input/'
import numpy as np
import pandas as pd
# 画图
import matplotlib.pyplot as plt
import seaborn as sns
# 警告不输出
import warnings
warnings.filterwarnings("ignore")
import time
import gc
# 进度条
from tqdm import tqdm
# 数据划分,评价指标
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import roc_auc_score
# 数据集path
train = pd.read_csv(INPUT_PATH + 'train.csv')
test = pd.read_csv(INPUT_PATH + 'test.csv') # 公开的测试集
train.shape, test.shape

train.head()

test.head()

train.describe()
查看所有列名,以及对应的列名
(nunique()方法)返回不同值的个数
for col in train.columns[1:-1]:
print(col, train[col].nunique())

可以看到这一列的不同值的个数是512个
train['wheezy-copper-turtle-magic'].value_counts()

col = 'wheezy-copper-turtle-magic'
sns.displot(train[col])

查看wheezy-copper-turtle-magic固定的情况下,其他字段的分布情况
col = 'dorky-peach-sheepdog-ordinal'
sns.displot(train[train['wheezy-copper-turtle-magic'] == 12][col])
sns.displot(train[t

文章详细介绍了在Kaggle的InstantGratification比赛中,通过数据预处理(如方差筛选特征),使用QDA(二次判别分析)和按特定特征分组(伪标签)的方法,逐步提高模型预测性能的过程。作者展示了如何利用LogisticRegression和QDA建立模型,并通过ROC曲线评估模型效果。
最低0.47元/天 解锁文章
1926

被折叠的 条评论
为什么被折叠?



