[kaggle竞赛] 毒蘑菇的二元预测

server/2024/9/20 7:18:43/ 标签: 机器学习, 大数据, 人工智能

毒蘑菇的二元预测

您提供了很多关于不同二元分类任务的资源和链接,看起来这些都是Kaggle竞赛中的参考资料和高分解决方案。为了帮助您更好地利用这些资源,这里是一些关键点的总结:

Playground Season 4 Episode 8

  • 主要关注的竞赛: 使用银行流失数据集进行二元分类。
  • 数据集: 已经重新组织并发布供参考。
  • 热门解决方案:
    • LightGBM 和 CatBoost 模型 (得分 0.8945)。
    • XGBoost 和随机森林模型。
    • 神经网络分类模型。

其他相关的竞赛和资源

  • 使用生物信号对吸烟者状况进行二元预测
    • EDA 和特征工程。
    • XGBoost 模型。
  • 使用软件缺陷数据集进行二元分类
    • EDA 和建模。
  • 机器故障的二元分类
    • EDA, 集成学习, ML pipeline, SHAP 分析。
  • 使用表格肾结石预测数据集进行二元分类
    • 多种模型对比。
  • 特色竞赛
    • 美国运通 - 违约预测
      • 特征工程和LightGBM模型。
    • 房屋信贷违约风险
      • 完整的EDA和特征重要性分析。

竞争指标 - Mathews 相关性系数

  • 定义: 衡量二元分类器输出质量的度量。
  • 资源:
    • Wikipedia 关于 Phi 系数的页面。
    • Voxco 博客关于 Matthews 相关性系数的文章。
    • 一篇关于 Matthews 相关性系数在生物数据挖掘中的应用的论文。
    • Scikit-learn 文档中关于 Matthews 相关性系数的说明。

希望这些信息能够帮助您更有效地开始学习和参与这些竞赛。如果您有具体的问题或者需要针对某个特定部分的帮助,请告诉我!

# 加载训练数据
train_data = pd.read_csv('train.csv')# 显示前几行数据以了解数据结构
print(train_data.head())# 查看数据的基本信息
print(train_data.info())

步骤 2: 数据探索与可视化

在这一步中,我们将对数据进行更深入的探索,并使用可视化工具来更好地理解数据的分布和特征之间的关系。

# 统计每种类型的蘑菇数量
print(train_data['class'].value_counts())# 可视化不同类型的蘑菇数量
plt.figure(figsize=(8, 6))
sns.countplot(x='class', data=train_data)
plt.title('Distribution of Mushroom Classes')
plt.show()# 查看各特征与目标变量之间的关系
fig, axs = plt.subplots(5, 5, figsize=(20, 20))
axs = axs.flatten()
for i, col in enumerate(train_data.columns[1:]):sns.countplot(x=col, hue='class', data=train_data, ax=axs[i])axs[i].set_title(f'Distribution of {col} by Class')
plt.tight_layout()
plt.show()

步骤 3: 数据预处理

接下来,我们将对数据进行预处理,包括特征编码和其他必要的变换。

# 对类别特征进行编码
label_encoder = LabelEncoder()# 遍历所有非数字特征
for col in train_data.select_dtypes(include=['object']).columns:train_data[col] = label_encoder.fit_transform(train_data[col])# 查看编码后的数据
print(train_data.head())

步骤 4: 构建模型

在这一步中,我们将构建 LightGBM 和 CatBoost 模型,并进行训练。

# 分割数据集
X = train_data.drop('class', axis=1)
y = train_data['class']# 划分训练集和验证集
X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=42)# 定义 LightGBM 模型
lgb_params = {'objective': 'binary','metric': 'auc','verbosity': -1,'boosting_type': 'gbdt','num_leaves': 31,'learning_rate': 0.05,'feature_fraction': 0.9,'bagging_fraction': 0.8,'bagging_freq': 5,'lambda_l1': 0.1,'lambda_l2': 0.1
}# 创建 LightGBM 数据集
lgb_train = lgb.Dataset(X_train, y_train)
lgb_val = lgb.Dataset(X_val, y_val, reference=lgb_train)# 训练 LightGBM 模型
lgb_model = lgb.train(lgb_params, lgb_train, num_boost_round=1000, valid_sets=[lgb_val], early_stopping_rounds=100)# 定义 CatBoost 模型
cb_params = {'loss_function': 'Logloss','eval_metric': 'AUC','learning_rate': 0.05,'depth': 6,'l2_leaf_reg': 10,'bootstrap_type': 'Bayesian','bagging_temperature': 0.2,'random_seed': 42,'allow_writing_files': False
}# 创建 CatBoost 数据集
cb_train = Pool(X_train, y_train)
cb_val = Pool(X_val, y_val)# 训练 CatBoost 模型
cb_model = CatBoostClassifier(**cb_params)
cb_model.fit(X_train, y_train, eval_set=(X_val, y_val), use_best_model=True, verbose=False)

步骤 5: 测试数据预测

最后,我们将使用训练好的模型对测试数据进行预测,并整理预测结果以符合 Kaggle 提交的要求。

# 加载测试数据
test_data = pd.read_csv('test.csv')# 对测试数据进行相同的特征编码
for col in test_data.select_dtypes(include=['object']).columns:test_data[col] = label_encoder.transform(test_data[col])# 获取测试数据的 ID
test_ids = test_data['id']# 删除不需要的列
test_features = test_data.drop('id', axis=1)# 使用模型进行预测
predictions_lgb = lgb_model.predict(test_features, num_iteration=lgb_model.best_iteration)
predictions_cb = cb_model.predict(test_features)# 将预测结果转换为二进制形式
predictions_lgb_binary = (predictions_lgb > 0.5).astype(int)
predictions_cb_binary = (predictions_cb > 0.5).astype(int)# 整理预测结果
submission_df = pd.DataFrame({'id': test_ids, 'class': predictions_lgb_binary})
submission_df['class'] = submission_df['class'].map({1: 'p', 0: 'e'})# 保存预测结果
submission_df.to_csv('submission.csv', index=False)

好的,现在我将为你提供一个完整的代码示例来解决“毒蘑菇的二元预测”问题。我们将使用 LightGBM 和 CatBoost 这两个模型来进行预测,并遵循之前讨论过的步骤。

首先,我们需要安装必要的库。如果你还没有安装它们,可以使用以下命令安装:

pip install pandas numpy scikit-learn lightgbm catboost matplotlib seaborn plotly

下面是完整的代码示例:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
import lightgbm as lgb
from catboost import CatBoostClassifier
from sklearn.metrics import matthews_corrcoef# 忽略警告
import warnings
warnings.filterwarnings('ignore')# 加载数据
train_data = pd.read_csv('train.csv')
test_data = pd.read_csv('test.csv')# 数据预处理
def preprocess_data(data):# 对类别特征进行编码label_encoder = LabelEncoder()for col in data.select_dtypes(include=['object']).columns:data[col] = label_encoder.fit_transform(data[col])return data# 预处理训练数据
train_data = preprocess_data(train_data)# 预处理测试数据
test_data = preprocess_data(test_data)# 数据分割
X = train_data.drop('class', axis=1)
y = train_data['class']
X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=42)# 定义 LightGBM 模型
lgb_params = {'objective': 'binary','metric': 'binary_logloss','verbosity': -1,'boosting_type': 'gbdt','num_leaves': 31,'learning_rate': 0.05,'feature_fraction': 0.9,'bagging_fraction': 0.8,'bagging_freq': 5,'lambda_l1': 0.1,'lambda_l2': 0.1
}# 创建 LightGBM 数据集
lgb_train = lgb.Dataset(X_train, y_train)
lgb_val = lgb.Dataset(X_val, y_val, reference=lgb_train)# 训练 LightGBM 模型
lgb_model = lgb.train(lgb_params, lgb_train, num_boost_round=1000, valid_sets=[lgb_val], early_stopping_rounds=100)# 定义 CatBoost 模型
cb_params = {'loss_function': 'Logloss','eval_metric': 'AUC','learning_rate': 0.05,'depth': 6,'l2_leaf_reg': 10,'bootstrap_type': 'Bayesian','bagging_temperature': 0.2,'random_seed': 42,'allow_writing_files': False
}# 训练 CatBoost 模型
cb_model = CatBoostClassifier(**cb_params)
cb_model.fit(X_train, y_train, eval_set=(X_val, y_val), use_best_model=True, verbose=False)# 测试数据预测
test_ids = test_data['id']
test_features = test_data.drop('id', axis=1)# 使用 LightGBM 进行预测
predictions_lgb = lgb_model.predict(test_features, num_iteration=lgb_model.best_iteration)
predictions_lgb_binary = (predictions_lgb > 0.5).astype(int)# 使用 CatBoost 进行预测
predictions_cb = cb_model.predict(test_features)
predictions_cb_binary = (predictions_cb > 0.5).astype(int)# 评估模型
mcc_lgb = matthews_corrcoef(y_val, lgb_model.predict(X_val, num_iteration=lgb_model.best_iteration) > 0.5)
mcc_cb = matthews_corrcoef(y_val, cb_model.predict(X_val) > 0.5)print("LightGBM Matthews Correlation Coefficient: ", mcc_lgb)
print("CatBoost Matthews Correlation Coefficient: ", mcc_cb)# 整理预测结果
submission_df = pd.DataFrame({'id': test_ids, 'class': predictions_lgb_binary})
submission_df['class'] = submission_df['class'].map({1: 'p', 0: 'e'})# 保存预测结果
submission_df.to_csv('submission.csv', index=False)# 可视化特征重要性
def plot_feature_importance(model, feature_names, title):fig, ax = plt.subplots(figsize=(12, 8))lgb.plot_importance(model, max_num_features=20, importance_type='gain', ax=ax)ax.set_title(title)plt.show()# 可视化 LightGBM 特征重要性
plot_feature_importance(lgb_model, X_train.columns, 'LightGBM Feature Importance')# 可视化 CatBoost 特征重要性
cb_model.plot_feature_importances(top_n=20, figsize=(12, 8), title='CatBoost Feature Importance')

这段代码完成了以下任务:

  1. 导入所需的库。
  2. 加载训练数据和测试数据。
  3. 对数据进行预处理,包括对类别特征进行编码。
  4. 划分数据集为训练集和验证集。
  5. 定义并训练 LightGBM 和 CatBoost 模型。
  6. 对测试数据进行预测。
  7. 评估模型的性能(使用 Matthews Correlation Coefficient)。
  8. 整理预测结果,并将其保存为 CSV 文件以供提交。
  9. 可视化特征重要性。

参考

Binary Classification with a Bank Churn Dataset

Playground Series - Season 4, Episode 1

OverviewDataCodeModelsDiscussionLeaderboardRulesTeamSubmissions

Samvel Kocharyan · 17th in this Competition · Posted 7 months ago

arrow_drop_up9

more_vert

17th Place Solution| AutoML + Unicorn's pollen + Lack of sleep

Context

S4E1 Playground "Binary Classification with a Bank Churn Dataset".

  • Business context: https://www.kaggle.com/competitions/playground-series-s4e1/overview
  • Data context: https://www.kaggle.com/competitions/playground-series-s4e1/data

Overview of the approach

Our final submission was a combination of AutoGluon 3-level stack we called "Frankenstein II" and set of averages from our previous models and some public notebooks.

Final submission was trained on the reduced set of features we got from OpenFE. Features were eliminated by BorutaSHAP and RFECV. Final model used 103 features.

Detail of the Submissions

We selected 2 submissions:

  • WeightedEnsemble_L3 0.89372 Public | 0.89637 Private | 0.898947 CV
  • Winning solution 0.90106 Private | 0.89687 Public. We got it from averaging 0.89673 and 0.89565 in last hours of the competition.

Frankenstein II schema

What worked for us?

  • Feature generation - 470 and Feature Elimination - 103
  • Data-Centric Approach (CleanLab)
  • Relabeling
  • AutoGluon 1.0.1 (thanks to @innixma)
  • BorutaSHAP framework and Skleran - RFECV
  • Ideas published by @paddykb, @thomasmeiner and respected community
  • Merging, Stacking, Ensembling, Averaging
  • Tons of experiments. Mainly for educative purposes
  • 🔥 Kaggle Alchemists Secret Society named after Akka från Kebnekajse
  • 🦄 Unicorn's pollen

What doesn't work for us this time?

  • PCA / ICA
  • Standalone Boosting models
  • TabPFN
  • Surnames features
  • Original dataset

Sources

  • https://www.kaggle.com/competitions/playground-series-s4e1/discussion/470363
  • https://www.kaggle.com/competitions/playground-series-s4e1/discussion/471164
  • https://www.kaggle.com/competitions/playground-series-s4e1/discussion/469859
  • https://www.kaggle.com/competitions/playground-series-s4e1/discussion/465192
  • https://www.kaggle.com/competitions/playground-series-s4e1/discussion/470610
  • https://www.kaggle.com/code/arunklenin/ps4e1-advanced-feature-engineering-ensemble
  • https://www.kaggle.com/code/thomasmeiner/ps4e1-eda-feature-engineering-modelling

根据您提供的信息,这是一个关于Kaggle竞赛“Playground Series - Season 4, Episode 1”的解决方案概述。在这个竞赛中,参赛者需要构建一个二分类模型来预测银行客户的流失情况。以下是该解决方案的主要部分:

业务背景

  • 目标:预测客户是否会离开银行。
  • 数据:包括客户的基本信息、交易记录等。

数据背景

  • 数据集:包含了多个特征,用于预测客户是否会选择离开银行。
  • 特征:包括但不限于年龄、性别、地理位置、账户余额、产品持有情况等。

解决方案概览

  • 最终提交:基于AutoGluon的3级堆叠模型,结合了之前模型的平均结果。
  • 特征工程:使用了OpenFE工具进行特征生成和消除,最终使用了103个特征。
  • 模型训练:使用了AutoGluon框架,并结合了BorutaSHAP和RFECV进行特征选择。

关键技术点

  1. 特征生成与消除:通过多种方法生成新特征,并利用BorutaSHAP和RFECV进行特征选择。
  2. 数据清理:使用CleanLab进行数据清洗。
  3. 标签修正:进行了重新标注以提高准确性。
  4. AutoGluon:使用版本1.0.1的AutoGluon进行自动机器学习
  5. 集成学习:通过堆叠、合并、平均等技术提高了模型的泛化能力。

未成功的方法

  • PCA/ICA:主成分分析和独立成分分析并未提升模型性能。
  • 单独的Boosting模型:单独使用Boosting模型效果不佳。
  • TabPFN:一种用于表格数据的神经网络架构,在本竞赛中未取得显著效果。
  • 姓氏特征:尝试使用客户的姓氏作为特征未能提升模型性能。
  • 原始数据集:仅使用原始数据集的效果不如经过特征工程的数据集。

实现代码

考虑到上述解决方案的复杂性和涉及的技术,下面是一个简化版的示例代码,展示如何使用AutoGluon进行自动机器学习,并结合特征选择的方法:

import pandas as pd
import numpy as np
from autogluon.tabular import TabularPredictor
from boruta import BorutaPy
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_selection import RFECV
from sklearn.model_selection import StratifiedKFold
from sklearn.pipeline import Pipeline# 数据路径
train_path = 'train.csv'
test_path = 'test.csv'# 加载数据
train_data = pd.read_csv(train_path)
test_data = pd.read_csv(test_path)# 数据预处理
# ...# 特征选择
# 使用BorutaSHAP进行特征选择
rf = RandomForestClassifier(n_jobs=-1, class_weight='balanced', max_depth=5)
feat_selector = BorutaPy(rf, n_estimators='auto', verbose=2, random_state=1)
feat_selector.fit(train_data.drop('target', axis=1), train_data['target'])# 使用RFECV进行特征选择
rfecv = RFECV(estimator=RandomForestClassifier(), step=1, cv=StratifiedKFold(5),scoring='accuracy', verbose=2)
pipeline = Pipeline([('rfecv', rfecv)])
pipeline.fit(train_data.drop('target', axis=1), train_data['target'])# 根据特征选择结果更新训练和测试数据
selected_features = list(set(feat_selector.support_) & set(pipeline.named_steps['rfecv'].support_))
train_data_selected = train_data[selected_features + ['target']]
test_data_selected = test_data[selected_features]# 使用AutoGluon进行自动机器学习
predictor = TabularPredictor(label='target', problem_type='binary').fit(train_data=train_data_selected, presets='best_quality', time_limit=1200)# 预测
predictions = predictor.predict(test_data_selected)# 保存预测结果
submission = pd.DataFrame({'id': test_data['id'], 'target': predictions})
submission.to_csv('submission.csv', index=False)

注意事项

  • 请确保已安装AutoGluon、BorutaPy和其他必要的库。
  • 以上代码示例假设数据集已经过适当的预处理,例如处理缺失值、转换类别特征等。
  • 根据实际数据集的特点,可能还需要进一步调整参数和方法。

参考资料和入门材料 - Playground Season 4 Episode 8

大家好,

祝您在 Playground 系列(第 4 季第 08 集)的同期剧集中一切顺利。我希望以下编译和入围的参考资料和链接能帮助您有效、快速地入职 -

原始数据集

比赛和原始数据集被重新组织并发布在这里,以供参考。

二元分类器游乐场比赛

使用银行流失数据集进行二元分类

得票最多的内核
  1. https://www.kaggle.com/code/abdmental01/bank-churn-lightgbm-and-catboost-0-8945
  2. https://www.kaggle.com/code/akhiljethwa/playground-s4e1-eda-modeling-xgboost
  3. https://www.kaggle.com/code/hardikgarg03/bank-churn-random-forest-xgboost-and-lightbgm
  4. https://www.kaggle.com/code/marianadeem755/bank-churn-classification-neural-network-xgboost
  5. https://www.kaggle.com/code/mouadberqia/bank-churn-prediction-beginner-friendly-0-88959
  6. https://www.kaggle.com/code/arunklenin/ps4e1-advanced-feature-engineering-ensemble
  7. https://www.kaggle.com/code/danishammar/bank-churn-165034-dl
  8. https://www.kaggle.com/code/aspillai/bank-churn-catboost-0-89626
高分方法和讨论
  1. https://www.kaggle.com/competitions/playground-series-s4e1/discussion/472496 -- 等级2
  2. https://www.kaggle.com/competitions/playground-series-s4e1/discussion/472413 -- 等级3
  3. https://www.kaggle.com/competitions/playground-series-s4e1/discussion/472636 -- 排名17
  4. https://www.kaggle.com/competitions/playground-series-s4e1/discussion/473257 -- 逾期提交
  5. https://www.kaggle.com/competitions/playground-series-s4e1/discussion/472502 -- 等级1
  6. https://www.kaggle.com/competitions/playground-series-s4e1/discussion/472497 -- 等级5
  7. https://www.kaggle.com/competitions/playground-series-s4e1/discussion/472466 -- 排名11

使用生物信号对吸烟者状况进行二元预测

得票最多的内核
  1. https://www.kaggle.com/code/cv13j0/efficient-prediction-of-smoker-status
  2. https://www.kaggle.com/code/arunklenin/ps3e24-eda-feature-engineering-ensemble
  3. https://www.kaggle.com/code/ravi20076/playgrounds3e24-eda-baseline
  4. https://www.kaggle.com/code/oscarm524/ps-s3-ep24-eda-modeling-submission
  5. https://www.kaggle.com/code/ashishkumarak/binary-classification-smoker-or-not-eda-xgboost
高分方法和讨论
  1. https://www.kaggle.com/competitions/playground-series-s3e24/discussion/455248 -- 排名 3
  2. https://www.kaggle.com/competitions/playground-series-s3e24/discussion/455296 -- 排名 4
  3. https://www.kaggle.com/competitions/playground-series-s3e24/discussion/455271 -- 排名 7
  4. https://www.kaggle.com/competitions/playground-series-s3e24/discussion/455268 -- 排名 8

使用软件缺陷数据集进行二元分类

得票最多的内核
  1. https://www.kaggle.com/code/ambrosm/pss3e23-eda-which-makes-sense
  2. https://www.kaggle.com/code/oscarm524/ps-s3-ep23-eda-modeling-submission
  3. https://www.kaggle.com/code/iqbalsyahakbar/ps3e23-binary-classification-for-beginners
  4. https://www.kaggle.com/code/ravi20076/playgrounds3e23-eda-baseline
  5. https://www.kaggle.com/code/zhukovoleksiy/ps-s3e23-explore-data-stacking-ensemble
高分方法和讨论
  1. https://www.kaggle.com/competitions/playground-series-s3e23/discussion/450315 -- 排名 2

机器故障的二元分类

得票最多的内核
  1. https://www.kaggle.com/code/tetsutani/ps3e17-eda-ensemble-ml-pipeline-shap
  2. https://www.kaggle.com/code/yantxx/xgboost-binary-classifier-machine-failure
  3. https://www.kaggle.com/code/manishkumar7432698/pse17-feature-engineering-tuning-optuna
  4. https://www.kaggle.com/code/tumpanjawat/s3e17-mf-eda-clustering-adaboost
  5. https://www.kaggle.com/code/akioonodera/ps-3-17-lgbm-bin
高分方法和讨论
  1. https://www.kaggle.com/competitions/playground-series-s3e17/discussion/419730 -- 排名 3
  2. https://www.kaggle.com/competitions/playground-series-s3e17/discussion/419643 -- 排名 11

使用表格肾结石预测数据集进行二元分类

得票最多的内核
  1. https://www.kaggle.com/code/richeyjay/kidney-stone-prediction-eda-binary-classification
  2. https://www.kaggle.com/code/kimtaehun/nice-eda-and-quick-xgb-baseline-in-2minutes
  3. https://www.kaggle.com/code/tumpanjawat/kidney-stone-eda-prediction-7-model-2-nn
  4. https://www.kaggle.com/code/hardikgarg03/kidney-stone-prediction
  5. https://www.kaggle.com/code/iqbalsyahakbar/ps3e12-simple-eda-fe-and-model-for-beginners
高分方法和讨论
  1. https://www.kaggle.com/competitions/playground-series-s3e12/discussion/402403 -- 等级 5
  2. https://www.kaggle.com/competitions/playground-series-s3e12/discussion/402416 -- 排名 8
  3. https://www.kaggle.com/competitions/playground-series-s3e12/discussion/402398 -- 排名 24

二元分类器特色竞赛

美国运通 - 违约预测

得票最多的内核
  1. https://www.kaggle.com/code/ambrosm/amex-eda-which-makes-sense
  2. https://www.kaggle.com/code/ragnar123/amex-lgbm-dart-cv-0-7977
  3. https://www.kaggle.com/code/kellibelcher/amex-default-prediction-eda-lgbm-baseline
  4. https://www.kaggle.com/code/ambrosm/amex-lightgbm-quickstart
  5. https://www.kaggle.com/code/jiweiliu/rapids-cudf-feature-engineering-xgb
高分内核
  1. https://www.kaggle.com/code/hideyukizushi/amex-inf-blend-onlyteam-v2
  2. https://www.kaggle.com/code/ragnar123/amex-lgbm-dart-cv-0-7977
  3. https://www.kaggle.com/code/thedevastator/the-fine-art-of-hyperparameter-tuning
  4. https://www.kaggle.com/code/rm1000/ensembling-with-vectorization
高分方法和讨论
  1. https://www.kaggle.com/competitions/amex-default-prediction/discussion/348111 -- 排名第一
  2. https://www.kaggle.com/competitions/amex-default-prediction/discussion/347637 -- 排名 2
  3. https://www.kaggle.com/competitions/amex-default-prediction/discussion/349741 -- 等级 3
  4. https://www.kaggle.com/competitions/amex-default-prediction/discussion/348097 -- 排名 5
  5. https://www.kaggle.com/competitions/amex-default-prediction/discussion/350538 -- 排名 9

房屋信贷违约风险

得票最多的内核
  1. https://www.kaggle.com/code/willkoehrsen/start-here-a-gentle-introduction
  2. https://www.kaggle.com/code/codename007/home-credit-complete-eda-feature-importance
  3. https://www.kaggle.com/code/willkoehrsen/introduction-to-manual-feature-engineering
高分方法和讨论
  1. https://www.kaggle.com/competitions/home-credit-default-risk/discussion/64821 -- 排名 1
  2. https://www.kaggle.com/competitions/home-credit-default-risk/discussion/64722 -- 排名 2
  3. https://www.kaggle.com/competitions/home-credit-default-risk/discussion/64596 -- 排名 3

Home Credit - 信用风险模型稳定性

得票最多的内核
  1. https://www.kaggle.com/code/greysky/home-credit-baseline
  2. https://www.kaggle.com/code/sergiosaharovskiy/home-credit-crms-2024-eda-and-submission
  3. https://www.kaggle.com/code/pereradulina/credit-risk-prediction-with-lightgbm-and-catboost
高分方法和讨论
  1. https://www.kaggle.com/competitions/home-credit-credit-risk-model-stability/discussion/508337 -- 排名第一
  2. https://www.kaggle.com/competitions/home-credit-credit-risk-model-stability/discussion/508113 -- 排名 10

竞争指标 - Mathews 相关性

  1. https://en.wikipedia.org/wiki/Phi_coefficient
  2. https://www.voxco.com/blog/matthewss-correlation-coefficient-definition-formula-and-advantages/
  3. The Matthews correlation coefficient (MCC) is more reliable than balanced accuracy, bookmaker informedness, and markedness in two-class confusion matrix evaluation | BioData Mining | Full Text
  4. matthews_corrcoef — scikit-learn 1.5.1 documentation -- 这是 scikit-learn 指标文档

祝你这一集一切顺利,学习愉快!


http://www.ppmy.cn/server/104953.html

相关文章

Java ArrayList和LinkedList

ArrayList ArrayList是Java中最常用的数据结构之一,它是一个动态数组的实现,允许你在程序中存储和管理一个可变大小的对象列表,我们可以添加或删除元素。 ArrayList 继承了 AbstractList ,并实现了 List 接口。 基本概念 Arra…

Git(面试篇)

目录 配置操作 全局配置 当前仓库配置 查看global配置 查看当前仓库配置 删除global配置 删除当前仓库配置 本地操作 查看变更情况 将当前目录及其子目录下所有变更都加入到暂存区 将仓库内所有变更都加入到暂存区 将指定文件添加到暂存区 比较工作区和暂存区的所有…

JavaScript学习文档(5):为什么需要函数、函数使用、函数传参、函数返回值、作用域、匿名函数、逻辑中断

目录 一、为什么需要函数 1、函数 2、说明 二、函数使用 1、函数的声明语法 2、函数名命名规范 3、函数调用语法 4、函数体 5、函数案例(数字求和) (1)计算1-100之间所有数字的和 三、函数传参 1、声明语法 2、调用语…

【Redis】Redis数据结构——List列表

List列表 命令lpushlpushxrpushrpushxlrangelpoprpoplindexlinsertllen 阻塞版本命令blpopbrpop 命令⼩结内部编码使用场景消息队列分频道的消息队列微博 Timeline 列表类型是⽤来存储多个有序的字符串,如图 2-19 所⽰,a、b、c、d、e 五个元素从左到右组…

Java 使用线程池和CountDownLatch分批插入或者更新数据

需求:在开发业务报表时,需要从MySQL数据库读取数据后进行操作,然后写入数据库,使用定时任务跑批。 分析:①兼顾性能,② MySQL没有Oracle那么方便、强大的存储过程。综上所述,使用线程池以分批提…

python dash框架 油气田可视化软件设计文档

V1.1:机器学习框架(神经网络) 时间范围优化 表格布局优化 添加前端设计元素布局 V1.0:基础布局和对应计算函数 要求 首先第一部分是通过神经网络预测天然气流量,其中输入开始时间和截止时间是为了显示这一段时间内的天然气流量预测结果 第二部分&…

前端实现首次访问,后续从本地访问

在前端实现将PDF文件下载到用户的本地磁盘&#xff0c;并在后续加载时使用本地文件&#xff0c;而不是重新从服务器下载&#xff0c;可以通过以下步骤实现&#xff1a; 1. **使用<a>标签的download属性**&#xff1a;当用户首次点击下载PDF时&#xff0c;通过<a>标…

私有仓库tomcat镜像构建

通过Tomcat安装包构建镜像 Dockerfile # 使用官方的OpenJDK镜像作为基础镜像 FROM xa-test.harbor.com:55555/idaas/openjdk:8u232 ENV CATALINA_HOME/usr/local/tomcat ENV PATH$CATALINA_HOME/bin:$PATH # 将Tomcat的压缩包复制到镜像中并解压到指定目录 COPY apache-tomcat…

Apollo9.0 PNC源码学习之Planning模块—— Lattice规划(六):横纵向运动轨迹评估

参考文章: (1)Apollo6.0代码Lattice算法详解——Part6:轨迹评估及碰撞检测对象构建 (2)自动驾驶规划理论与实践Lattice算法详解 0 前言 横纵向运动轨迹的评估,主要通过构建定点巡航和定点停车两个场景下,对纵向运动参考速度、加速度、加加速度的大小进行检验和过滤,然…

1.初识redis

文章目录 1.认识redis1.1 mysql和redis 对比1.2分布式系统1.2.1单机架构与分布式架构1.2.2数据库分离(应用服务器和存储服务器分离)与负载均衡1.2.3负载均衡器1.2.4 数据库读写分离1.2.5 数据库服务器引入缓存1.2.6数据库分库分表1.2.7 引入微服务 2.常见概念解释2.1 应用(Appl…

JDK15.0.2安装

JDK15.0.2安装 1. 下载 下载地址&#xff1a; https://www.oracle.com/java/technologies/downloads/archive/ 通过百度网盘分享的文件&#xff1a;jdk-15.0.2_windows-x64_bin.exe 链接&#xff1a;https://pan.baidu.com/s/15AOcTby3YLSp26_btCkEIw 提取码&#xff1a;vs7…

10. 指针数组和数组指针详细区别

指针数组和数组指针在存储位置和占用内存大小方面也有显著的区别&#xff0c;尤其是它们的结构不同导致内存分布上的差异。接下来详细说明它们在这两个方面的区别&#xff1a; 1. 指针数组 (Array of Pointers) 定义回顾&#xff1a; int *array[5];这里 array 是一个指针数…

K8S部署MySQL5.7的主从服务

mysql-slave-0是master mysql-slave-1是备份 当mysql写的时候&#xff0c;找headless service中的 mysql-slave-0.mysql57-slave-headless&#xff1b;当mysql读的时候&#xff0c;找clusterip service中的mysql57-slave-read读&#xff0c;实现读写分离。 statefulset维护两个…

Spring + Boot + Cloud + JDK8 + Elasticsearch 单节点 模式下实现全文检索高亮-分页显示 快速入门案例

1. 安装elasticsearchik分词器插件 sudo wget https://release.infinilabs.com/analysis-ik/stable/elasticsearch-analysis-ik-8.13.4.zip sudo mkdir -p ./es_plugins/analysis-ik sudo mkdir ./es_data sudo unzip elasticsearch-analysis-ik-8.13.4.zip -d ./es_plugins/a…

探索提示工程 Prompt Engineering的奥妙

一、探索提示工程 1. 介绍通用人工智能和专用人工智能 人工智能&#xff08;AI&#xff09;可以分为通用人工智能&#xff08;AGI&#xff09;和专用人工智能&#xff08;Narrow AI&#xff09;。AGI是一种能够理解、学习和执行任何人类可以完成的任务的智能。与此相对&#x…

Neo4j 图数据库入门

图形数据库存储节点和关系&#xff0c;而不是表或文档。数据的存储方式就像你在白板上勾画想法一样。您的数据存储不受预定义模型的限制&#xff0c;允许以非常灵活的方式考虑和使用它。 一、核心概念&#xff1a;属性图形模型 Neo4j使用属性图数据库模型。图数据结构由节点(离…

【图形学】TA之路-基于Unity Shader编程之初体验

学习shader之前你必须知道的事情&#xff1a; Unity开发引擎、Direct3D、Shader他们之间的关系 Direct3D 是一个底层图形 API&#xff0c;它直接与 GPU &#xff08;显卡&#xff09;交互&#xff0c;提供了访问硬件加速功能的接口。Unity 开发引擎&#xff0c;它封装了很多底…

自然语言处理系列三十九》条件随机场CRF算法原理

注&#xff1a;此文章内容均节选自充电了么创始人&#xff0c;CEO兼CTO陈敬雷老师的新书《自然语言处理原理与实战》&#xff08;人工智能科学与技术丛书&#xff09;【陈敬雷编著】【清华大学出版社】 文章目录 自然语言处理系列三十九条件随机场(CRF)算法原理CRF与HMM 总结 …

【LeetCode每日一题】——1046.最后一块石头的重量

文章目录 一【题目类别】二【题目难度】三【题目编号】四【题目描述】五【题目示例】六【题目提示】七【解题思路】八【时间频度】九【代码实现】十【提交结果】 一【题目类别】 优先队列 二【题目难度】 简单 三【题目编号】 1046.最后一块石头的重量 四【题目描述】 有…

【Java 搜索二维矩阵 I II,多数元素 I II,分治法 二分法 摩尔投票法】

搜索二维矩阵 I II&#xff0c;多数元素&#xff0c;分治法 & 二分法 & 摩尔投票法 题目1&#xff1a;力扣-搜索二维矩阵[https://leetcode.cn/problems/search-a-2d-matrix/description/](https://leetcode.cn/problems/search-a-2d-matrix/description/)分治-排除法分…