Kaggle竞赛系列_SpaceshipTitanic金牌方案分析_数据分析

news2024/9/21 18:38:12

文章目录

    • 【文章系列】
    • 【前言】
    • 【比赛简介】
    • 【正文】
      • (一)数据获取
      • (二)数据分析
        • 1. 缺失值
        • 2. 重复值
        • 3. 属性类型分析
        • 4. 类别分析
        • 5. 分析目标数值占比
      • (三)属性分析
        • 1. 对年龄Age分析
          • (1)直方图分析
          • (2)创建新属性
        • 2. 对支出属性进行分析
          • (1)直方图分析
          • (2)创建新属性
        • 3. 对离散属性进行分析
          • (1)直方图分析
        • 4. 对定性属性进行分析
          • (1)属性分析
          • (2)根据PassengerId划分group
          • (3)对Cabin属性进一步划分
          • (4)根据Name的姓氏划分出家庭组
      • (四)归纳总结
      • (五)写在最后

【文章系列】

第一章 初探Kaggle竞赛————Kaggle竞赛系列_Titanic比赛

第二章 知识补充_随机森林————数学建模系列_随机森林

第三章 知识补充_LightGBM————集成学习之Boosting方法系列_LightGBM

第四章 再战Kaggle竞赛————Kaggle竞赛系列_SpaceshipTitanic比赛

第五章 重温回顾_学习金牌方法_数据分析————Kaggle竞赛系列_SpaceshipTitanic金牌方案分析_数据分析

第六章 重温回顾_学习金牌方法_数据处理————Kaggle竞赛系列_SpaceshipTitanic金牌方案分析_数据处理

【前言】

Spaceship Titanic比赛,类似Titanic比赛,只是增加了更多的属性以及更大的数据量,仍是一个二分类问题。

今天要分析的是一篇大神的解决方案,看完后觉得干货满满,由衷地敬佩他们对数据分析的细致程度,对比之下只觉得之前自己的分析仅仅是表面功夫,单纯靠着模型的强大能力去完成任务。看来以后还是得不断地向各位前辈大佬学习,完善自己的解决方案!!!

image-20240127131649713

项目代码 : 🚀 Spaceship Titanic: A complete guide 🏆 | Kaggle

我的解决方案:Kaggle竞赛系列_SpaceshipTitanic比赛

【比赛简介】

Spaceship Titanic比赛是一个在Kaggle上举办的机器学习挑战,参赛者的任务是预测Spaceship Titanic在与时空异常碰撞时,哪些乘客被传送到了另一个维度。这个比赛提供了从飞船损坏的计算机系统中恢复的一组个人记录,参赛者需要使用这些数据来进行预测。

【正文】

(一)数据获取

参考之前的Titanic比赛的数据获取操作 Kaggle_Titanic比赛

(二)数据分析

image-20240125094535642

  • train.csv - 用于训练数据的大约三分之二(约8700名)乘客的个人记录。
  • PassengerId - 每位乘客的唯一标识。每个标识的格式为gggg_pp,其中gggg表示乘客所在的团体,pp是他们在团体中的编号。一个团体中的人通常是家庭成员,但并不总是如此。
  • HomePlanet - 乘客出发的星球,通常是他们的永久居住星球。
  • CryoSleep - 表示乘客是否选择在航程期间被置于悬浮动状态。处于冷冻睡眠状态的乘客被限制在他们的舱房内。
  • Cabin - 乘客所住的舱房号码。格式为deck/num/side,其中side可以是P(港口)或S(舷侧)。
  • Destination - 乘客将要下船的星球。
  • Age - 乘客的年龄。
  • VIP - 乘客是否支付额外费用获得特殊的VIP服务。
  • RoomService, FoodCourt, ShoppingMall, Spa, VRDeck - 乘客在太空巨轮泰坦尼克号的许多豪华设施上的费用金额。
  • Name - 乘客的名字和姓氏。
  • Transported - 乘客是否被传送到另一个维度。这是目标,也就是您要预测的列。
  • test.csv - 剩余三分之一(约4300名)乘客的个人记录,用作测试数据。您的任务是预测这一集合中乘客的Transported值。
  • sample_submission.csv - 一个以正确格式的提交文件。
  • PassengerId - 测试集中每位乘客的标识。
  • Transported - 目标。对于每位乘客,预测True或False。
1. 缺失值
print('TRAIN SET MISSING VALUES:')
print(train.isna().sum())
print('')
print('TEST SET MISSING VALUES:')
print(test.isna().sum())

image-20240127133241505

2. 重复值
print(f'Duplicates in train set: {train.duplicated().sum()}, ({np.round(100*train.duplicated().sum()/len(train),1)}%)')
print('')
print(f'Duplicates in test set: {test.duplicated().sum()}, ({np.round(100*test.duplicated().sum()/len(test),1)}%)')

image-20240127133252458

3. 属性类型分析
train.nunique()

image-20240126180311252

4. 类别分析
train.dtypes

image-20240127133310358

一般而言,连续型属性被存储为floatdouble类型,离散型属性被存储为objectint类型。

  • 6个连续性属性(RoomService,FoodCourt,ShoppingMall,Spa,VRDeck,Age)
  • 4个离散属性(HomePlanet,CryoSleep,Destination,VIP)
  • 剩余3个描述性/定性属性(PassengerId,Name,Cabin)
5. 分析目标数值占比
# 特征尺寸
plt.figure(figsize=(6,6))

# 饼状图
train['Transported'].value_counts().plot.pie(explode=[0.1,0.1], autopct='%1.1f%%', shadow=True, textprops={'fontsize':16}).set_title("Target distribution")

image-20240126180500759

分布平衡,因此不需要采用过采样、欠采样方法。

(三)属性分析

1. 对年龄Age分析
(1)直方图分析

直方图关键参数:hue=Target属性

# 特征尺寸
plt.figure(figsize=(10,4))

# 直方图
sns.histplot(data=train, x='Age', hue='Transported', binwidth=1, kde=True)

plt.title('Age distribution')
plt.xlabel('Age (years)')

image-20240126180645751

注意到:

  • 0-18岁的青少年更容易被转移。
  • 18-25岁的人被转移的可能性比不被转移的可能性要小。
  • 25岁以上的人被转移的可能性和没有被转移的可能性差不多。
(2)创建新属性

根据直方图False与True的高度关系,对年龄划分为多层,并依次建立一个新特征。

# 新特征-训练集
train['Age_group']=np.nan
train.loc[train['Age']<=12,'Age_group']='Age_0-12'
train.loc[(train['Age']>12) & (train['Age']<18),'Age_group']='Age_13-17'
train.loc[(train['Age']>=18) & (train['Age']<=25),'Age_group']='Age_18-25'
train.loc[(train['Age']>25) & (train['Age']<=30),'Age_group']='Age_26-30'
train.loc[(train['Age']>30) & (train['Age']<=50),'Age_group']='Age_31-50'
train.loc[train['Age']>50,'Age_group']='Age_51+'

# 新特征-测试集
test['Age_group']=np.nan
test.loc[test['Age']<=12,'Age_group']='Age_0-12'
test.loc[(test['Age']>12) & (test['Age']<18),'Age_group']='Age_13-17'
test.loc[(test['Age']>=18) & (test['Age']<=25),'Age_group']='Age_18-25'
test.loc[(test['Age']>25) & (test['Age']<=30),'Age_group']='Age_26-30'
test.loc[(test['Age']>30) & (test['Age']<=50),'Age_group']='Age_31-50'
test.loc[test['Age']>50,'Age_group']='Age_51+'

# 新特征的分布图
plt.figure(figsize=(10,4))
g=sns.countplot(data=train, x='Age_group', hue='Transported', order=['Age_0-12','Age_13-17','Age_18-25','Age_26-30','Age_31-50','Age_51+'])
plt.title('Age group distribution')

image-20240126182059818

2. 对支出属性进行分析
(1)直方图分析
# 支出特征
exp_feats=['RoomService', 'FoodCourt', 'ShoppingMall', 'Spa', 'VRDeck']

# 绘图
fig=plt.figure(figsize=(10,20))
for i, var_name in enumerate(exp_feats):
    # 左图
    ax=fig.add_subplot(5,2,2*i+1)
    sns.histplot(data=train, x=var_name, axes=ax, bins=30, kde=False, hue='Transported')
    ax.set_title(var_name)
    
    # 右图(核密度估计)
    ax=fig.add_subplot(5,2,2*i+2)
    sns.histplot(data=train, x=var_name, axes=ax, bins=30, kde=True, hue='Transported')
    plt.ylim([0,100])
    ax.set_title(var_name)
fig.tight_layout()  # 改善外观
plt.show()

image-20240127134808931

注意到:

  • 大多数人都没有花钱,因此可以创建一个二元属性对是否有支出进行划分。
  • 有少数的异常值。
  • 被运输的人往往花费更少。
  • RoomService、Spa和VRDeck与FoodCourt和ShoppingMall有着不同的分布
(2)创建新属性

创建一个新属性记录5个支出属性的总开支。再创建一个二元属性对是否有支出进行划分。

# 新特征-训练集
train['Expenditure']=train[exp_feats].sum(axis=1)
train['No_spending']=(train['Expenditure']==0).astype(int)

# 新特征-测试集
test['Expenditure']=test[exp_feats].sum(axis=1)
test['No_spending']=(test['Expenditure']==0).astype(int)

# 新特征的分布图
fig=plt.figure(figsize=(12,4))
plt.subplot(1,2,1)
sns.histplot(data=train, x='Expenditure', hue='Transported', bins=200)
plt.title('Total expenditure (truncated)')
plt.ylim([0,200])
plt.xlim([0,20000])

plt.subplot(1,2,2)
sns.countplot(data=train, x='No_spending', hue='Transported')
plt.title('No spending indicator')
fig.tight_layout()

image-20240126182217365

3. 对离散属性进行分析
(1)直方图分析

离散属性——>countplot

# 离散特征
cat_feats=['HomePlanet', 'CryoSleep', 'Destination', 'VIP']

# 绘图
fig=plt.figure(figsize=(10,16))
for i, var_name in enumerate(cat_feats):
    ax=fig.add_subplot(4,1,i+1)
    sns.countplot(data=train, x=var_name, axes=ax, hue='Transported')
    ax.set_title(var_name)
fig.tight_layout()  # 改善外观
plt.show()

image-20240126181442663

注意到:

  • VIP似乎不是一个有用的功能,对目标分割差不多相等。相比之下,CryoSleep似乎是一个非常有用的功能。因此我们可以考虑去掉VIP列以防止过拟合。
4. 对定性属性进行分析
(1)属性分析
# 定性特征
qual_feats=['PassengerId', 'Cabin' ,'Name']

# 预览定性特征
train[qual_feats].head()

image-20240126181717264

注意到:

  • Passengerld采用gggg_pp的形式,其中gggg表示乘客所在的旅行团,pp表示他们在旅行团中的编号。
  • Cabin的形式为deck/num/side,其中side可以是P代表左舷,也可以是S代表右舷。

因此我们可以从Passengerld特征中提取群组和群组大小。从Cabin特征中提取甲板、数量和侧面。从Name特征中提取姓氏来识别家庭。

(2)根据PassengerId划分group
# 新特征-分组
train['Group'] = train['PassengerId'].apply(lambda x: x.split('_')[0]).astype(int)
test['Group'] = test['PassengerId'].apply(lambda x: x.split('_')[0]).astype(int)

# 绘图
plt.figure(figsize=(20,4))
plt.subplot(1,2,1)
sns.histplot(data=train, x='Group', hue='Transported', binwidth=1)
plt.title('Group')

image-20240126182514714

发现分组过多,不好进行独热编码,因此新建一个属性根据分组的人数记录每个分组的数量。

# 新特征-分组大小
train['Group_size']=train['Group'].map(lambda x: pd.concat([train['Group'], test['Group']]).value_counts()[x])
test['Group_size']=test['Group'].map(lambda x: pd.concat([train['Group'], test['Group']]).value_counts()[x])


plt.subplot(1,2,2)
sns.countplot(data=train, x='Group_size', hue='Transported')
plt.title('Group size')
fig.tight_layout()

image-20240126182629213

发现除了1人组更不容易被传输,其他人数的分组基本上都是更容易被传输,因此可以将其他人数的分组划分在一起。为此我们可以再新建一个属性来判断该数据是否是1人组(是否独自出行)。

# 新特征
train['Solo']=(train['Group_size']==1).astype(int)
test['Solo']=(test['Group_size']==1).astype(int)

# 新特质分布图
plt.figure(figsize=(10,4))
sns.countplot(data=train, x='Solo', hue='Transported')
plt.title('Passenger travelling solo or not')
plt.ylim([0,3000])

image-20240126182857568

(3)对Cabin属性进一步划分
# 现在用离群值替换NaN(这样我们就可以拆分特征)
train['Cabin'].fillna('Z/9999/Z', inplace=True)
test['Cabin'].fillna('Z/9999/Z', inplace=True)

#  新特征-训练集
train['Cabin_deck'] = train['Cabin'].apply(lambda x: x.split('/')[0])
train['Cabin_number'] = train['Cabin'].apply(lambda x: x.split('/')[1]).astype(int)
train['Cabin_side'] = train['Cabin'].apply(lambda x: x.split('/')[2])

#  新特征-测试集
test['Cabin_deck'] = test['Cabin'].apply(lambda x: x.split('/')[0])
test['Cabin_number'] = test['Cabin'].apply(lambda x: x.split('/')[1]).astype(int)
test['Cabin_side'] = test['Cabin'].apply(lambda x: x.split('/')[2])

# 把Nan的放回去(我们稍后会填充这些)
train.loc[train['Cabin_deck']=='Z', 'Cabin_deck']=np.nan
train.loc[train['Cabin_number']==9999, 'Cabin_number']=np.nan
train.loc[train['Cabin_side']=='Z', 'Cabin_side']=np.nan
test.loc[test['Cabin_deck']=='Z', 'Cabin_deck']=np.nan
test.loc[test['Cabin_number']==9999, 'Cabin_number']=np.nan
test.loc[test['Cabin_side']=='Z', 'Cabin_side']=np.nan

# 丢弃Cabin属性(我们不再需要它了)
train.drop('Cabin', axis=1, inplace=True)
test.drop('Cabin', axis=1, inplace=True)

# 新特征的分布图
fig=plt.figure(figsize=(10,12))
plt.subplot(3,1,1)
sns.countplot(data=train, x='Cabin_deck', hue='Transported', order=['A','B','C','D','E','F','G','T'])
plt.title('Cabin deck')

plt.subplot(3,1,2)
sns.histplot(data=train, x='Cabin_number', hue='Transported',binwidth=20)
plt.vlines(300, ymin=0, ymax=200, color='black')
plt.vlines(600, ymin=0, ymax=200, color='black')
plt.vlines(900, ymin=0, ymax=200, color='black')
plt.vlines(1200, ymin=0, ymax=200, color='black')
plt.vlines(1500, ymin=0, ymax=200, color='black')
plt.vlines(1800, ymin=0, ymax=200, color='black')
plt.title('Cabin number')
plt.xlim([0,2000])

plt.subplot(3,1,3)
sns.countplot(data=train, x='Cabin_side', hue='Transported')
plt.title('Cabin side')
fig.tight_layout()

image-20240126183134741

注意到Cabin_number被按照300的数量进行划分,每个划分的False与True的高度都不一样。这意味着我们可以压缩这个特征被压缩成一个分类特征,其他注意事项:客舱甲板的“T”似乎是一个异常值(只有5个样本)。

# 新特征-训练集
train['Cabin_region1']=(train['Cabin_number']<300).astype(int)   # 独热编码
train['Cabin_region2']=((train['Cabin_number']>=300) & (train['Cabin_number']<600)).astype(int)
train['Cabin_region3']=((train['Cabin_number']>=600) & (train['Cabin_number']<900)).astype(int)
train['Cabin_region4']=((train['Cabin_number']>=900) & (train['Cabin_number']<1200)).astype(int)
train['Cabin_region5']=((train['Cabin_number']>=1200) & (train['Cabin_number']<1500)).astype(int)
train['Cabin_region6']=((train['Cabin_number']>=1500) & (train['Cabin_number']<1800)).astype(int)
train['Cabin_region7']=(train['Cabin_number']>=1800).astype(int)

# 新特征-测试集
test['Cabin_region1']=(test['Cabin_number']<300).astype(int)   # 独热编码
test['Cabin_region2']=((test['Cabin_number']>=300) & (test['Cabin_number']<600)).astype(int)
test['Cabin_region3']=((test['Cabin_number']>=600) & (test['Cabin_number']<900)).astype(int)
test['Cabin_region4']=((test['Cabin_number']>=900) & (test['Cabin_number']<1200)).astype(int)
test['Cabin_region5']=((test['Cabin_number']>=1200) & (test['Cabin_number']<1500)).astype(int)
test['Cabin_region6']=((test['Cabin_number']>=1500) & (test['Cabin_number']<1800)).astype(int)
test['Cabin_region7']=(test['Cabin_number']>=1800).astype(int)

# 新特征的分布图
plt.figure(figsize=(10,4))
train['Cabin_regions_plot']=(train['Cabin_region1']+2*train['Cabin_region2']+3*train['Cabin_region3']+4*train['Cabin_region4']+5*train['Cabin_region5']+6*train['Cabin_region6']+7*train['Cabin_region7']).astype(int)
sns.countplot(data=train, x='Cabin_regions_plot', hue='Transported')
plt.title('Cabin regions')
train.drop('Cabin_regions_plot', axis=1, inplace=True)

image-20240126183439865

(4)根据Name的姓氏划分出家庭组

根据形式划分出家庭组,再根据家庭组的大小划分出一个新的二元属性。

# 现在用离群值替换NaN(这样我们就可以拆分特征)
train['Name'].fillna('Unknown Unknown', inplace=True)
test['Name'].fillna('Unknown Unknown', inplace=True)

# 新特征-姓氏
train['Surname']=train['Name'].str.split().str[-1]
test['Surname']=test['Name'].str.split().str[-1]

# 新特征-家庭大小
train['Family_size']=train['Surname'].map(lambda x: pd.concat([train['Surname'],test['Surname']]).value_counts()[x])
test['Family_size']=test['Surname'].map(lambda x: pd.concat([train['Surname'],test['Surname']]).value_counts()[x])

# 把Nan的放回去(我们稍后会填充这些)
train.loc[train['Surname']=='Unknown','Surname']=np.nan
train.loc[train['Family_size']>100,'Family_size']=np.nan
test.loc[test['Surname']=='Unknown','Surname']=np.nan
test.loc[test['Family_size']>100,'Family_size']=np.nan

# 删除Name(我们不再需要它了)
train.drop('Name', axis=1, inplace=True)
test.drop('Name', axis=1, inplace=True)

# 新特征分布图
plt.figure(figsize=(12,4))
sns.countplot(data=train, x='Family_size', hue='Transported')
plt.title('Family size')

image-20240126183656161

(四)归纳总结

数据分析流程总结

思维导图 (1)

(五)写在最后

至此,我们已经完成了对数据集的初步分析,下一篇我们会对该数据集进行预处理。

Kaggle竞赛系列_SpaceshipTitanic金牌方案分析_数据处理

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1421750.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

OpenHarmony—环境准备

JS SDK安装失败处理指导 问题现象 下载JS SDK时&#xff0c;下载失败&#xff0c;提示“Install Js dependencies failed”。解决措施 JS SDK下载失败&#xff0c;一般情况下&#xff0c;主要是由于npm代理配置问题&#xff0c;或未清理npm缓存信息导致&#xff0c;可按照如…

如何更新github上fork的项目(需要一定git基础)

如何更新Fork的项目(需要一定git基础) 前言&#xff1a;本文记录一下自己在github上fork了大佬的开源博客项目https://github.com/tangly1024/NotionNext&#xff0c;如何使用git克隆以及自定义开发和同步合并原项目更新迭代内容的的步骤 如何更新fork的项目(进阶版) 首先你…

MyBatis 源码系列:MyBatis 解析配置文件、二级缓存、SQL

文章目录 解析全局配置文件二级缓存解析解析二级缓存缓存中的调用过程缓存中使用的设计模式 解析SQL 解析全局配置文件 启动流程分析 String resource "mybatis-config.xml"; //将XML配置文件构建为Configuration配置类 reader Resources.getResourceAsReader(re…

华天动力OA ntkodownload.jsp 任意文件读取漏洞复现

0x01 产品简介 华天动力OA是一款将先进的管理思想、 管理模式和软件技术、网络技术相结合,为用户提供了低成本、 高效能的协同办公和管理平台。 0x02 漏洞概述 华天动力OA ntkodownload.jsp接口处存在任意文件读取漏洞,未经身份认证的攻击者可利用此漏洞获取服务器内部敏感…

条款32:确定你的public继承塑模出 is-a 关系

如果你编写类D(“派生类”)public继承类B(“基类”)&#xff0c;就是在告诉C编译器(以及代码的读者)每个类型D的对象都是类型B的对象&#xff0c;但反之则不然。 class Person {...}; class Student: public Person {...}; void eat(const Person& p); // 素有的Person都…

笔记本从零安装ubuntu server系统+环境配置

文章目录 前言相关链接ubuntu Server 安装教程屏幕自动息屏关上盖子不休眠MobaXterm外网SSH内网穿透IPV6远程 为什么我要笔记本装Linux为什么要换ubuntu Server版能否连接wifi之后Linux 配置清单总结 前言 之前装了个ubuntu desktop 版&#xff0c;发现没有命令行&#xff0c;…

FLUENT Meshing Watertight Geometry工作流入门 - 3 BOI FOI

本视频中学到的内容&#xff1a; 如何使用和设置 “Body Of Influence”&#xff08;BOI&#xff09;、“Face Of Influence”&#xff08;FOI&#xff09;。 视频链接&#xff1a; 【FLUENT Meshing入门教程-局部尺寸控制3-BOI&FOI-哔哩哔哩】 https://b23.tv/UHYY828 在…

【React】前端项目引入阿里图标

【React】前端项目引入阿里图标 1、登录自己的iconfont-阿里巴巴矢量图标库&#xff0c;把需要的图标加入到自己的项目中去&#xff1b;2、加入并进入到项目中去选择Symbol点击复制代码3、安装ant-design/icons4. 新建一个MyIcon.js文件内容如下5、在项目中使用 1、登录自己的i…

【Linux笔记】文件描述符与重定向

一、Linux关于文件操作的一些系统调用 1、open和close 我们在C语言阶段已经学过很多文件操作的函数&#xff0c;今天我们要来看看操作系统中对于文件是怎么操作的。 1.1、open与close的用法 C语言的库函数中有很多关于文件操作的接口&#xff0c;包括fopen、fclose、fprint…

《Docker技术革命:从虚拟机到容器化,全面解析Docker的原理与应用-上篇》

文章目录 Docker为什么会出现总结 Docker的思想Docker历史总结 Docker能干嘛虚拟机技术虚拟机技术的缺点 容器化技术Docker和虚拟机技术的区别 Docker概念Docker的基本组成镜像&#xff08;image)容器&#xff08;container&#xff09;仓科&#xff08;repository&#xff09;…

基于大数据的B站数据分析系统的设计与实现

摘要&#xff1a;随着B站&#xff08;哔哩哔哩网&#xff09;在国内视频分享平台的崛起&#xff0c;用户规模和数据量不断增加。为了更好地理解和利用这些海量的B站数据&#xff0c;设计并实现了一套基于Python的B站数据分析系统。该系统采用了layui作为前端框架、Flask作为后端…

防火墙综合拓扑(NAT、双机热备)

实验需求 拓扑 实验注意点&#xff1a; 先配置双机热备&#xff0c;再来配置安全策略和NAT两台双机热备的防火墙的接口号必须一致如果其中一台防火墙有过配置&#xff0c;最好清空或重启&#xff0c;不然配置会同步失败两台防火墙同步完成后&#xff0c;可以直接在主状态防火墙…

逻辑回归与感知机详解

一逻辑回归 采用log函数作为代价函数 1 用于二分类问题 2 cost成本函数定义 3 求最小值&#xff0c;链式求导法则 4 梯度下降法 5 结构图表示 二 感知机 样本点到超平面距离法 1 线性二分类问题 2 点到直线距离 3 更新w 和b 参数 4 算法流程 5 例子

真机调试,微信小程序,uniapp项目在微信开发者工具中真机调试,手机和电脑要连同一个wifi,先清空缓存,页面从登录页进入,再点真机调试,这样就不会报错了

微信小程序如何本地进行真机调试&#xff1f;_unity生成的微信小程序怎么在电脑上真机测试-CSDN博客 微信小程序 真机调试 注意事项 uniapp项目在微信开发者工具中真机调试&#xff0c;手机和电脑要连同一个wifi&#xff0c;先清空缓存&#xff0c;页面从登录页进入&#xf…

mac系统内存越来越大怎么清理?CleanMyMac X轻松解决

MacBook作为一款优秀的笔记本电脑&#xff0c;自带的macOS操作系统更加稳定、安全、易用。但是&#xff0c;随着安装的应用越来越多&#xff0c;应用的功能越来越强大&#xff0c;占用的内存也越来越多&#xff0c;从而导致电脑变慢。那么&#xff0c;MacBook如何清理内存呢&am…

【Node.js基础】Node.js的介绍与安装

文章目录 前言一、什么是Node.js&#xff1f;二、安装Node.js2.1 Windows系统2.2 macOS系统2.3 Linux系统 三、运行js代码总结 前言 随着互联网技术的不断发展&#xff0c;构建高性能、实时应用的需求日益增长。Node.js作为一种服务器端运行时环境&#xff0c;以其事件驱动、非…

CentOS gui 图形界面显示文字乱码

一、现象 CentOS&#xff08;CentOS 7.5&#xff09;控制台下显示中文乱码&#xff1a; 或者通过X11 Forwarding远程显示CentOS的图形化程序文字乱码&#xff1a; 二、解决方法 安装中文语言包&#xff1a; yum install kde-l10n-Chinese 注&#xff1a;网上有些文章会推荐安…

k8s中调整Pod数量限制的方法

一、介绍 Kubernetes节点每个默认允许最多创建110个pod&#xff0c;有时可能由于主机配置扩容的问题&#xff0c;从而需要修改节点pod运行数量的限制。 即&#xff1a;需要调整Node节点的最大可运行Pod数量。 一般来说&#xff0c;只需要在kubelet启动命令中增加–max-pods参数…

代码随想录 Leetcode222.完全二叉树的节点个数

题目&#xff1a; 代码&#xff08;首刷自解 2024年1月30日&#xff09;&#xff1a; class Solution { public:int countNodes(TreeNode* root) {int res 0;if (root nullptr) return res;queue<TreeNode*> deque;TreeNode* cur root;deque.push(cur);int size 0;w…

搭建WebGL开发环境

前言 本篇文章介绍如何搭建WebGL开发环境 WebGL WebGL的技术规范继承自免费和开源的OpenGL ES标准&#xff0c;从某种意义上说&#xff0c;WebGL就是Web版的OpenGL ES&#xff0c;而OpenGL ES是从OpenGL中派生出来的。他们的应用环境有区别&#xff0c;一般来说&#xff1a;…