Multi-Threading & others

从单线程到多线程编程转变中遇到的各种挑战,包括线程间的协作、资源竞争及调试技巧等。

- I'm reading one book from Intel Press on Multi-Threading these days, and I feel I've stepped into a new world.
For single threading work, what you need to consider is just a line that how your codes walk along with. Everything is sequential, you don't need to worry the action you take this monent could impact the status a few moments ago or later. 
While in the multi-threading world, you should play a cooperative team role with a high team-spirit. Your thread cannot conflict with the other thread, while all the threads may share the same resource. During the competition, you should try your best to avoid them freezing or fighting. What's more, the underlying hardware also counts in this coordination,or should I say competition again. Debugging is also much trickier. You cannot use stepping & breakpoints.

-  There're so much details in System development~! I mean the development a raw machine, without OS on it.
Even worse, these details are also mixed together! So now I've totally understood why people say a high barrier stands before the system development.

:\pycharm\代码\.venv\Scripts\python.exe E:\pycharm\代码\代码调试9.py ⚠️ skopt未安装!贝叶斯优化不可用。请运行: pip install scikit-optimize ⚠️ shap未安装!SHAP可解释性不可用。请运行: pip install shap ========================================================================================== 【增强版机器学习分析系统】 基于张继权教授‘四因子理论’:致灾因子、孕灾环境、承灾体、防灾减灾能力 功能:自动区分分类/回归 + 多模型 + 缺失值修复 + 结果可视化 ========================================================================================== 📁 数据路径: E:\pycharm\meta\整合数据.csv 🎯 目标变量: PFOA 1. 加载数据... ❌ 编码 'utf-8' 解码失败,尝试下一个... ✅ 数据加载成功!编码: gbk | 形状: (137, 111) 🧹 已删除 96 个 'Unnamed' 列。 2.1 应用张继权教授四因子理论进行特征分组... 【四因子特征分组表】 风险因子 特征数量 特征列表 致灾因子 2 PFBA;PFOS 孕灾环境 2 经度;纬度 承灾体 2 城市;作物类型 防灾减灾能力 0 无 其他 8 样本编号;PFPeA;PFHxA;PFHpA;PFNA;PFDA;PFBS;PFHxS 2. 探索性数据分析(EDA)... 统计项 值 样本数 137 特征数 14 目标变量 PFOA 唯一值数 111 🔍 检测到连续型目标变量 'PFOA'(唯一值占比0.81),切换为回归任务。 3. 数据预处理与标准化... 🧹 删除 12 行因 'PFOA' 缺失 (NaN) 训练集: (100, 14), 测试集: (25, 14) 4. 初始化 回归 模型... ✅ 已加载 5 个回归模型 5. 模型训练与评分评估... ➜ 训练 线性回归... ➜ 训练 随机森林回归... ➜ 训练 XGBoost回归... ➜ 训练 LightGBM回归... [LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.000047 seconds. You can set `force_row_wise=true` to remove the overhead. And if memory is not enough, you can set `force_col_wise=true`. [LightGBM] [Info] Total Bins 263 [LightGBM] [Info] Number of data points in the train set: 100, number of used features: 11 [LightGBM] [Info] Start training from score 2.342153 [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf File "E:\pycharm\代码\.venv\lib\site-packages\joblib\externals\loky\backend\context.py", line 257, in _count_physical_cores cpu_info = subprocess.run( File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 493, in run with Popen(*popenargs, **kwargs) as process: File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1311, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf ➜ 训练 CatBoost回归... 【回归模型性能对比表】 r2 mse rmse 模型 XGBoost回归 0.878321 0.074486 0.272921 随机森林回归 0.74793 0.154304 0.392816 CatBoost回归 0.416065 0.357455 0.597875 线性回归 -13.316012 8.763525 2.960325 LightGBM回归 -28.162328 17.851676 4.225124 🏆 最佳模型: XGBoost回归 (R²: 0.8783) ========================================================================================== ✅ 完整机器学习分析流程执行完毕! ========================================================================================== 进程已结束,退出代码为 0 继续解决报错,代码中加入相关性分析等,生成更多的图
最新发布
11-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值