当前位置: 首页 > news >正文

机器学习模型评估指标

模型的评估指标是衡量一个模型应用于对应任务的契合程度,常见的指标有
  1. 准确率(Accuracy): 正确预测的样本数占总样本数的比例。适用于类别分布均衡的数据集。

  2. 精确率(Precision): 在所有被预测为正类的样本中,实际为正类的比例。高精确率意味着较少的假正例。

  3. 召回率(Recall): 在所有实际为正类的样本中,被正确预测为正类的比例。高召回率意味着较少的假负例。

  4. F1分数(F1 Score): 精确率和召回率的调和平均,是两者之间的平衡指标。F1分数在类别不平衡时特别有用。

  5. AUC-ROC曲线下面积(AUC): ROC曲线下的面积,衡量模型对正负样本的区分能力。AUC值越高,模型性能越好。

  6. 平均精度(Average Precision): 每个类别的精确率的平均值,特别用于多标签分类问题。

  7. 平均召回率(Average Recall): 每个类别的召回率的平均值,同样适用于多标签分类。

  8. 混淆矩阵(Confusion Matrix): 一个表格,显示了实际类别与预测类别之间的关系,可以用来计算上述指标。

  9. 平均F1分数(Average F1 Score): 对每个类别计算F1分数后取平均值。

  10. 马修距离(Mean Absolute Error, MAE): 预测值与真实值之间差的绝对值的平均。

  11. 均方误差(Mean Square Error, MSE): 预测值与真实值之间差的平方的平均值。

  12. 均方根误差(Root Mean Square Error, RMSE): MSE的平方根,提供了误差的尺度化度量。

  13. 对数平均绝对误差(Mean Absolute Percentage Error, MAPE): 预测值与真实值之间差的绝对值的百分比的平均值。

  14. 洛斯损失(Log Loss): 常用于逻辑回归模型,衡量预测概率与实际标签之间的差异。

  15. 杰卡指数(Jaccard Index): 1减去预测类别与真实类别的交集与并集的比例,用于衡量两个集合的相似度。

结合场景来看待这些指标

  1. 分类问题(Classification):

    • 类别不平衡(Class Imbalance): 在这种情况下,召回率(Recall)和F1分数(F1 Score)通常比准确率(Accuracy)更能反映模型性能,因为准确率可能会因为多数类而产生误导。
    • 多类别分类(Multi-class Classification): 精确率(Precision)、召回率(Recall)和F1分数(F1 Score)可以为每个类别单独计算,然后平均得到宏平均(Macro-average)或微平均(Micro-average)指标。
  2. 回归问题(Regression):

    • 均方误差(Mean Squared Error, MSE)和均方根误差(Root Mean Squared Error, RMSE)是衡量预测值与实际值之间差异的常用指标。
    • 平均绝对误差(Mean Absolute Error, MAE)提供了预测误差的平均绝对值,对异常值不敏感。
  3. 异常检测:

    • 查准率(Precision)和召回率(Recall)在这里同样重要,尤其是在异常类别较少的情况下。
  4. 排名问题:

    • 平均精度(Mean Average Precision, MAP)是一个关键指标,它衡量的是模型在整个排名列表中保持高精确度的能力。
  5. 多标签分类:

    • 每个标签的精确率和召回率可以单独计算,然后根据标签的分布进行加权平均。
  6. 多输出问题:

    • 对于每个输出变量,可以单独计算MSE、RMSE或准确率等指标。

1.准确率

即希望11(模型正确预测正例)、10(模型正确预测负例)的占比更高

基本原理

准确率是将预测正确的样本数量与总样本数量之比,它衡量的是模型在整个数据集上的表现。然而,当数据集不平衡(即某一类样本数量明显多于其他类别)时,准确率可能不是一个很好的评估指标,因为即使模型预测所有样本都属于多数类别,也能获得相对较高的准确率。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, confusion_matrix# 生成模拟数据集
X, y = make_classification(n_samples=1000, n_features=20, n_classes=2, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练逻辑回归模型
model = LogisticRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred = model.predict(X_test)# 计算准确率
accuracy = accuracy_score(y_test, y_pred)
print("Accuracy:", accuracy)# 绘制混淆矩阵
conf_matrix = confusion_matrix(y_test, y_pred)
print("Confusion Matrix:")
print(conf_matrix)# 绘制评估指标
plt.imshow(conf_matrix, cmap='binary', interpolation='None')
plt.colorbar()
plt.xticks([0, 1])
plt.yticks([0, 1])
plt.xlabel('Predicted Label')
plt.ylabel('True Label')
plt.title('Confusion Matrix')
plt.show()

2.精确率

基本原理

精确率的核心思想是衡量模型在所有预测为正类别的样本中,真正为正类别的样本所占的比例。这个指标对于那些需要准确识别正例的任务尤为重要,比如医学诊断中的疾病检测。高精确率表示模型在识别正例方面有很好的表现。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import precision_score, confusion_matrix# 生成模拟数据集
X, y = make_classification(n_samples=1000, n_features=20, n_classes=2, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练逻辑回归模型
model = LogisticRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred = model.predict(X_test)# 计算精确率
precision = precision_score(y_test, y_pred)
print("Precision:", precision)# 绘制混淆矩阵
conf_matrix = confusion_matrix(y_test, y_pred)
print("Confusion Matrix:")
print(conf_matrix)# 绘制评估指标
plt.imshow(conf_matrix, cmap='binary', interpolation='None')
plt.colorbar()
plt.xticks([0, 1])
plt.yticks([0, 1])
plt.xlabel('Predicted Label')
plt.ylabel('True Label')
plt.title('Confusion Matrix')
plt.show()

3.召回率

基本原理

召回率的核心思想是衡量模型在识别正例方面的表现。它强调了模型对于实际为正类别的样本的识别能力,对于那些需要尽量避免漏诊的任务,比如疾病检测,召回率是一个非常重要的评估指标。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import recall_score, confusion_matrix# 生成模拟数据集
X, y = make_classification(n_samples=1000, n_features=20, n_classes=2, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练逻辑回归模型
model = LogisticRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred = model.predict(X_test)# 计算召回率
recall = recall_score(y_test, y_pred)
print("Recall:", recall)# 绘制混淆矩阵
conf_matrix = confusion_matrix(y_test, y_pred)
print("Confusion Matrix:")
print(conf_matrix)# 绘制评估指标
plt.imshow(conf_matrix, cmap='binary', interpolation='None')
plt.colorbar()
plt.xticks([0, 1])
plt.yticks([0, 1])
plt.xlabel('Predicted Label')
plt.ylabel('True Label')
plt.title('Confusion Matrix')
plt.show()

4.F1分数

基本原理

F1分数综合考虑了模型的精确率和召回率,因此可以在一定程度上弥补精确率和召回率单独使用时的不足。F1分数越高,表示模型在识别和预测正类别方面的综合表现越好。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import f1_score, confusion_matrix# 生成模拟数据集
X, y = make_classification(n_samples=1000, n_features=20, n_classes=2, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练逻辑回归模型
model = LogisticRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred = model.predict(X_test)# 计算F1分数
f1 = f1_score(y_test, y_pred)
print("F1 Score:", f1)# 绘制混淆矩阵
conf_matrix = confusion_matrix(y_test, y_pred)
print("Confusion Matrix:")
print(conf_matrix)# 绘制评估指标
plt.imshow(conf_matrix, cmap='binary', interpolation='None')
plt.colorbar()
plt.xticks([0, 1])
plt.yticks([0, 1])
plt.xlabel('Predicted Label')
plt.ylabel('True Label')
plt.title('Confusion Matrix')plt.show()

5.ROC曲线和AUC

基本原理

ROC曲线基于真正例率和假正例率,它展示了在不同分类阈值下,模型在识别正例和负例方面的性能。ROC曲线上的点越靠近左上角,表示模型性能越好。AUC是ROC曲线下的面积,它等于ROC曲线与横轴之间的面积,可以用来比较不同模型的性能,AUC越大表示模型性能越好。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import roc_curve, auc# 生成模拟数据集
X, y = make_classification(n_samples=1000, n_features=20, n_classes=2, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练逻辑回归模型
model = LogisticRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred_proba = model.predict_proba(X_test)[:, 1]# 计算ROC曲线和AUC
fpr, tpr, thresholds = roc_curve(y_test, y_pred_proba)
roc_auc = auc(fpr, tpr)
print("AUC:", roc_auc)# 绘制ROC曲线
plt.figure()
plt.plot(fpr, tpr, color='darkorange', lw=2, label='ROC curve (area = %0.2f)' % roc_auc)
plt.plot([0, 1], [0, 1], color='navy', lw=2, linestyle='--')
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title('Receiver Operating Characteristic Curve')
plt.legend(loc="lower right")
plt.show()

6.混淆矩阵

基本原理

混淆矩阵用于描述模型在不同类别上的预测结果,帮助评估模型的分类准确性和错误情况。通过混淆矩阵,可以计算出模型的精确率、召回率、F1分数等评估指标,从而更全面地评估模型的性能。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix# 生成模拟数据集
X, y = make_classification(n_samples=1000, n_features=20, n_classes=2, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练逻辑回归模型
model = LogisticRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred = model.predict(X_test)# 计算混淆矩阵
conf_matrix = confusion_matrix(y_test, y_pred)
print("Confusion Matrix:")
print(conf_matrix)# 绘制混淆矩阵
plt.imshow(conf_matrix, cmap='binary', interpolation='None')
plt.colorbar()
plt.xticks([0, 1])
plt.yticks([0, 1])
plt.xlabel('Predicted Label')
plt.ylabel('True Label')
plt.title('Confusion Matrix')
plt.show()

7.均方误差

基本原理

均方误差衡量了模型的预测值与真实值之间的平均偏差的平方。当模型的预测值与真实值之间的偏差较大时,MSE会增大;而当偏差较小时,MSE会减小。因此,MSE越小表示模型对数据的拟合程度越好。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error# 生成模拟数据集
X, y = make_regression(n_samples=100, n_features=1, noise=0.1, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练线性回归模型
model = LinearRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred = model.predict(X_test)# 计算均方误差
mse = mean_squared_error(y_test, y_pred)
print("Mean Squared Error:", mse)# 绘制评估指标
plt.scatter(X_test, y_test, color='black', label='Actual')
plt.plot(X_test, y_pred, color='blue', linewidth=3, label='Predicted')
plt.title('Actual vs Predicted')
plt.xlabel('X')
plt.ylabel('y')
plt.legend()
plt.show()

8.平均绝对误差

基本原理

平均绝对误差衡量了模型的预测值与真实值之间的平均绝对偏差。当模型的预测值与真实值之间的偏差较大时,MAE会增大;而当偏差较小时,MAE会减小。因此,MAE越小表示模型对数据的拟合程度越好。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_absolute_error# 生成模拟数据集
X, y = make_regression(n_samples=100, n_features=1, noise=0.1, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练线性回归模型
model = LinearRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred = model.predict(X_test)# 计算平均绝对误差
mae = mean_absolute_error(y_test, y_pred)
print("Mean Absolute Error:", mae)# 绘制评估指标
plt.scatter(X_test, y_test, color='black', label='Actual')
plt.plot(X_test, y_pred, color='blue', linewidth=3, label='Predicted')
plt.title('Actual vs Predicted')
plt.xlabel('X')
plt.ylabel('y')
plt.legend()
plt.show()

9.对数损失

基本原理

对数损失衡量了模型的预测概率分布与真实标签之间的差异。当模型的预测概率分布与真实标签完全一致时,对数损失为0;当二者差异较大时,对数损失增大。因此,对数损失越小表示模型性能越好。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import log_loss# 生成模拟数据集
X, y = make_classification(n_samples=1000, n_features=20, n_classes=2, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练逻辑回归模型
model = LogisticRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred_proba = model.predict_proba(X_test)# 计算对数损失
logloss = log_loss(y_test, y_pred_proba)
print("Log Loss:", logloss)# 绘制评估指标
thresholds = np.linspace(0.01, 0.99, 100)
logloss_values = []
for threshold in thresholds:
    y_pred_threshold = (y_pred_proba[:, 1] > threshold).astype(int)
    logloss_values.append(log_loss(y_test, y_pred_threshold))plt.plot(thresholds, logloss_values)
plt.xlabel('Threshold')
plt.ylabel('Log Loss')
plt.title('Log Loss vs Threshold')
plt.show()

10.R平方

基本原理

R平方衡量了模型对数据的拟合程度,其取值范围在0到1之间。当模型对数据的拟合程度越好时,R平方越接近1;当模型对数据的拟合程度较差时,R平方越接近0。当模型的拟合程度与随机平均水平相当时,R平方可能为负。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score# 生成模拟数据集
X, y = make_regression(n_samples=100, n_features=1, noise=0.1, random_state=42)# 划分训练集和测试集
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)# 训练线性回归模型
model = LinearRegression()
model.fit(X_train, y_train)# 在测试集上做预测
y_pred = model.predict(X_test)# 计算R平方
r2 = r2_score(y_test, y_pred)
print("R-squared:", r2)# 绘制评估指标
plt.scatter(X_test, y_test, color='black', label='Actual')
plt.plot(X_test, y_pred, color='blue', linewidth=3, label='Predicted')
plt.title('Actual vs Predicted')
plt.xlabel('X')
plt.ylabel('y')
plt.legend()
plt.show()

11.交叉验证分数

基本原理

交叉验证分数的原理是通过多次训练和测试模型,利用每次测试集上的性能指标来评估模型的泛化能力。通过多次重复这个过程并计算平均值,可以得到更可靠的性能评估结果。

核心点

代码例子

import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import LogisticRegression# 加载数据集
iris = load_iris()
X, y = iris.data, iris.target# 初始化逻辑回归模型
model = LogisticRegression()# 计算交叉验证分数
cv_scores = cross_val_score(model, X, y, cv=5, scoring='accuracy')# 打印交叉验证分数
print("Cross-Validation Scores:", cv_scores)
print("Mean Cross-Validation Score:", np.mean(cv_scores))# 绘制评估指标
plt.plot(range(1, 6), cv_scores, marker='o')
plt.xlabel('Fold')
plt.ylabel('Accuracy')
plt.title('Cross-Validation Scores')
plt.show()

相关文章:

机器学习模型评估指标

模型的评估指标是衡量一个模型应用于对应任务的契合程度,常见的指标有: 准确率(Accuracy): 正确预测的样本数占总样本数的比例。适用于类别分布均衡的数据集。 精确率(Precision): 在所有被预测为正类的样…...

C# 特性

总目录 C# 语法总目录 C# 特性 特性1. 特性类自定义格式2. 特性的位置参数和命名参数3. 特性的目标4. 指定多个特性5. 调用者信息特性 特性 1. 特性类自定义格式 自定义特性类需要继承自Attribute类,特性使用通常都会省略名字后面的Attribute,会自动识…...

Reactor测试框架之StepVerifier

Reactor测试框架之StepVerifier 测试步骤1、创建StepVerifier实例2、添加断言3、执行验证 代码实例 在响应式编程中,Reactor框架提供了StepVerifier测试类,用于对响应式序列进行断言和验证。StepVerifier主要用于对Publisher发出的元素序列进行逐步的、精…...

k8s helm部署kafka集群(KRaft模式)——筑梦之路

添加helm仓库 helm repo add bitnami "https://helm-charts.itboon.top/bitnami" --force-update helm repo add grafana "https://helm-charts.itboon.top/grafana" --force-update helm repo add prometheus-community "https://helm-charts.itboo…...

unity action委托举例

using System; using UnityEngine; public class DelegateExample : MonoBehaviour { void Start() { // 创建委托实例并添加方法 Action myAction Method1; myAction Method2; myAction Method3; // 调用委托,会依次执…...

conda 批量安装requirements.txt文件

conda 批量安装requirements.txt文件中包含的组件依赖 conda install --yes --file requirements.txt #这种执行方式,一遇到安装不上就整体停止不会继续下面的包安装。 下面这条命令能解决上面出现的不执行后续包的问题,需要在CMD窗口执行: 点…...

Flutter:封装一个自用的bottom_picker选择器

效果图&#xff1a;单列选择器 使用bottom_picker: ^2.9.0实现&#xff0c;单列选择器&#xff0c;官方文档 pubspec.yaml # 底部选择 bottom_picker: ^2.9.0picker_utils.dart AppTheme&#xff1a;自定义的颜色 TextWidget.body Text() <Widget>[].toRow Row()下边代…...

Group3r:一款针对活动目录组策略安全的漏洞检测工具

关于Group3r Group3r是一款针对活动目录组策略安全的漏洞检测工具&#xff0c;可以帮助广大安全研究人员迅速枚举目标AD组策略中的相关配置&#xff0c;并识别其中的潜在安全威胁。 Group3r专为红蓝队研究人员和渗透测试人员设计&#xff0c;该工具可以通过将 LDAP 与域控制器…...

支持向量机算法(一):像讲故事一样讲明白它的原理及实现奥秘

1、支持向量机算法介绍 支持向量机&#xff08;Support Vector Machine&#xff0c;SVM&#xff09;是一种基于统计学习理论的模式识别方法&#xff0c; 属于有监督学习模型&#xff0c;主要用于解决数据分类问题。SVM将每个样本数据表示为空间中的点&#xff0c;使不同类别的…...

力扣-数组-35 搜索插入位置

解析 时间复杂度要求&#xff0c;所以使用二分的思想&#xff0c;漏掉了很多问题&#xff0c;这里记录 在left-right1时&#xff0c;已经找到了插入位置&#xff0c;但是没有赋值&#xff0c;然后break&#xff0c;所以导致一直死循环。 if(right - left 1){result right;b…...

List ---- 模拟实现LIST功能的发现

目录 listlist概念 list 中的迭代器list迭代器知识const迭代器写法list访问自定义类型 附录代码 list list概念 list是可以在常数范围内在任意位置进行插入和删除的序列式容器&#xff0c;并且该容器可以前后双向迭代。list的底层是双向链表结构&#xff0c;双向链表中每个元素…...

HashMap和HashTable区别问题

并发&#xff1a;hashMap线程不安全&#xff0c;hashTable线程安全&#xff0c;底层在put操作的方法上加了synchronized 初始化&#xff1a;hashTable初始容量为11&#xff0c;hashmap初始容量为16 阔容因子&#xff1a;阔容因子都是0.75 扩容比例&#xff1a; 补充 hashMap…...

mysql -> 达梦数据迁移(mbp大小写问题兼容)

安装 注意后面初始化需要忽略大小写 初始化程序启动路径 F:\dmdbms\tool dbca.exe 创建表空间&#xff0c;用户&#xff0c;模式 管理工具启动路径 F:\dmdbms\tool manager.exe 创建表空间 创建用户 创建同名模式&#xff0c;指定模式拥有者TEST dts 工具数据迁移 mysql -&g…...

leetcode热门100题1-4

第一天 两数之和 //暴力枚举 class Solution { public:vector<int> twoSum(vector<int>& nums, int target) {int n nums.size();for (int i 0; i < n; i) {for (int j i 1; j < n; j) {if (nums[i] nums[j] target) {return {i, j};}}}return {…...

作业:IO:day2

题目一 第一步&#xff1a;创建一个 struct Student 类型的数组 arr[3],初始化该数组中3个学生的属性 第二步&#xff1a;编写一个叫做save的函数&#xff0c;功能为 将数组arr中的3个学生的所有信息&#xff0c;保存到文件中去&#xff0c;使用fread实现fwrite 第三步&#xf…...

UVM: TLM机制

topic overview 不建议的方法&#xff1a;假如没有TLM TLM TLM 1.0 整个TLM机制下&#xff0c;底层逻辑离不开动作发起者和被动接受者这个底层的模型基础&#xff0c;但实际上&#xff0c;在验证环境中&#xff0c;任何一个组件&#xff0c;都有可能成为动作的发起者&#xff0…...

flink的EventTime和Watermark

时间机制 Flink中的时间机制主要用在判断是否触发时间窗口window的计算。 在Flink中有三种时间概念&#xff1a;ProcessTime、IngestionTime、EventTime。 ProcessTime&#xff1a;是在数据抵达算子产生的时间&#xff08;Flink默认使用ProcessTime&#xff09; IngestionT…...

arcgis的合并、相交、融合、裁剪、联合、标识操作的区别和使用

1、相交 需要输入两个面要素&#xff0c;最终得到的是两个输入面要素相交部分的结果面要素。 2、合并 合并能将两个单独存放的两个要素类的内容&#xff0c;汇集到一个要素类里面。 3、融合 融合能将一个要素类内的所有元素融合成一个整体。 4、裁剪 裁剪需要输入两个面要…...

【Leetcode 热题 100】20. 有效的括号

问题背景 给定一个只包括 ‘(’&#xff0c;‘)’&#xff0c;‘{’&#xff0c;‘}’&#xff0c;‘[’&#xff0c;‘]’ 的字符串 s s s&#xff0c;判断字符串是否有效。 有效字符串需满足&#xff1a; 左括号必须用相同类型的右括号闭合。左括号必须以正确的顺序闭合。每…...

比较procfs 、 sysctl和Netlink

procfs 文件系统和 sysctl 的使用: procfs 文件系统(/proc) procfs 文件系统是 Linux 内核向用户空间暴露内核数据结构以及配置信息的一种方式。`procfs` 的挂载点是 /proc 目录,这个目录中的文件和目录呈现内核的运行状况和配置信息。通过读写这些文件,可以查看和控制内…...

生成xcframework

打包 XCFramework 的方法 XCFramework 是苹果推出的一种多平台二进制分发格式&#xff0c;可以包含多个架构和平台的代码。打包 XCFramework 通常用于分发库或框架。 使用 Xcode 命令行工具打包 通过 xcodebuild 命令可以打包 XCFramework。确保项目已经配置好需要支持的平台…...

Leetcode 3576. Transform Array to All Equal Elements

Leetcode 3576. Transform Array to All Equal Elements 1. 解题思路2. 代码实现 题目链接&#xff1a;3576. Transform Array to All Equal Elements 1. 解题思路 这一题思路上就是分别考察一下是否能将其转化为全1或者全-1数组即可。 至于每一种情况是否可以达到&#xf…...

(十)学生端搭建

本次旨在将之前的已完成的部分功能进行拼装到学生端&#xff0c;同时完善学生端的构建。本次工作主要包括&#xff1a; 1.学生端整体界面布局 2.模拟考场与部分个人画像流程的串联 3.整体学生端逻辑 一、学生端 在主界面可以选择自己的用户角色 选择学生则进入学生登录界面…...

IGP(Interior Gateway Protocol,内部网关协议)

IGP&#xff08;Interior Gateway Protocol&#xff0c;内部网关协议&#xff09; 是一种用于在一个自治系统&#xff08;AS&#xff09;内部传递路由信息的路由协议&#xff0c;主要用于在一个组织或机构的内部网络中决定数据包的最佳路径。与用于自治系统之间通信的 EGP&…...

连锁超市冷库节能解决方案:如何实现超市降本增效

在连锁超市冷库运营中&#xff0c;高能耗、设备损耗快、人工管理低效等问题长期困扰企业。御控冷库节能解决方案通过智能控制化霜、按需化霜、实时监控、故障诊断、自动预警、远程控制开关六大核心技术&#xff0c;实现年省电费15%-60%&#xff0c;且不改动原有装备、安装快捷、…...

Ascend NPU上适配Step-Audio模型

1 概述 1.1 简述 Step-Audio 是业界首个集语音理解与生成控制一体化的产品级开源实时语音对话系统&#xff0c;支持多语言对话&#xff08;如 中文&#xff0c;英文&#xff0c;日语&#xff09;&#xff0c;语音情感&#xff08;如 开心&#xff0c;悲伤&#xff09;&#x…...

Java线上CPU飙高问题排查全指南

一、引言 在Java应用的线上运行环境中&#xff0c;CPU飙高是一个常见且棘手的性能问题。当系统出现CPU飙高时&#xff0c;通常会导致应用响应缓慢&#xff0c;甚至服务不可用&#xff0c;严重影响用户体验和业务运行。因此&#xff0c;掌握一套科学有效的CPU飙高问题排查方法&…...

Netty从入门到进阶(二)

二、Netty入门 1. 概述 1.1 Netty是什么 Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients. Netty是一个异步的、基于事件驱动的网络应用框架&#xff0c;用于…...

淘宝扭蛋机小程序系统开发:打造互动性强的购物平台

淘宝扭蛋机小程序系统的开发&#xff0c;旨在打造一个互动性强的购物平台&#xff0c;让用户在购物的同时&#xff0c;能够享受到更多的乐趣和惊喜。 淘宝扭蛋机小程序系统拥有丰富的互动功能。用户可以通过虚拟摇杆操作扭蛋机&#xff0c;实现旋转、抽拉等动作&#xff0c;增…...

Sklearn 机器学习 缺失值处理 获取填充失值的统计值

💖亲爱的技术爱好者们,热烈欢迎来到 Kant2048 的博客!我是 Thomas Kant,很开心能在CSDN上与你们相遇~💖 本博客的精华专栏: 【自动化测试】 【测试经验】 【人工智能】 【Python】 使用 Scikit-learn 处理缺失值并提取填充统计信息的完整指南 在机器学习项目中,数据清…...