最新发布第19页
排序
【人工智能】【Python】线性回归算法实验
本实验运用线性回归、岭回归和Lasso回归模型,基于包含442个样本的糖尿病数据集探究正则化方法对模型拟合的影响。通过引入正态分布噪声模拟实际数据特性,使用Z-score标准化后划分训练集/测试集...
【递归】2的幂
递归法: class Solution: def isPowerOfTwo(self, n: int) -> bool: if n==1: return True if n<=0 or n%2!=0: return Fals...
【C】if-else if-else和switch-case
if-else if-else #include<stdio.h> int main() { int type=0; scanf('%d',&type); if (type==1) printf('早'); else if (type==2) printf('中'); else if (type==3) printf('晚'); else...
【算法】【Python】N皇后问题的三种解法
本文分析了N皇后问题的三种解法:回溯法通过逐行尝试并安全检测实现,时间复杂度O(n!)但实现简单;分支限界法利用列和对角线标记数组将安全判断优化至O(1),通过空间换时间显著提升速度;位运算...
【C++】四舍五入
#include <iostream> #include <cmath> using namespace std; float a[100000]; int main(){ int n; cin >> n; for (int i=0;i<n;i++){ cin >> a[i]; } for (int i=0;i<n;i++){ cou...
【Linux】记录一次逆天&抽象的PVE故障修复记录
我记录了一次修复PVE服务器启动失败的经历。故障原因是安装ntpdate与系统网络服务ifupdown2冲突,导致开机时卡死。由于系统使用了ZFS文件系统,标准的救援模式无法进入,我只能通过Ventoy启动Ub...











































