【Chapter 3】Machine Learning Classification Case_Prediction of diabetes-XGBoost

文章目录

  • 1、XGBoost Algorithm
  • 2、Comparison of algorithm implementation between Python code and Sentosa_DSML community edition
    • (1) Data reading and statistical analysis
    • (2)Data preprocessing
    • (3)Model Training and Evaluation
    • (4)Model visualization
  • 3、summarize

1、XGBoost Algorithm

  This article will utilize the diabetes dataset to construct an XGBoost classification prediction model through Python code and the Sentosa_DSML community edition, respectively. Subsequently, the model will be evaluated, including the selection and analysis of evaluation metrics. Finally, the experimental results and conclusions will be presented, demonstrating the effectiveness and accuracy of the model in predicting diabetes classification, providing technical means and decision support for early diagnosis and intervention of diabetes.

2、Comparison of algorithm implementation between Python code and Sentosa_DSML community edition

(1) Data reading and statistical analysis

1、Implementation in Python code

import os
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import xgboost as xgb
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, confusion_matrix, roc_curve, auc
from matplotlib import rcParams
from datetime import datetime
from sklearn.preprocessing import LabelEncoderfile_path = r'.\xgboost分类案例-糖尿病结果预测.csv'
output_dir = r'.\xgb分类'if not os.path.exists(file_path):raise FileNotFoundError(f"文件未找到: {file_path}")if not os.path.exists(output_dir):os.makedirs(output_dir)df = pd.read_csv(file_path)print("缺失值统计:")
print(df.isnull().sum())print("原始数据前5行:")
print(df.head())

  After reading in, perform statistical analysis on the data information

rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['SimHei']
stats_df = pd.DataFrame(columns=['列名', '数据类型', '最大值', '最小值', '平均值', '非空值数量', '空值数量','众数', 'True数量', 'False数量', '标准差', '方差', '中位数', '峰度', '偏度','极值数量', '异常值数量'
])def detect_extremes_and_outliers(column, extreme_factor=3, outlier_factor=6):if not np.issubdtype(column.dtype, np.number):return None, Noneq1 = column.quantile(0.25)q3 = column.quantile(0.75)iqr = q3 - q1lower_extreme = q1 - extreme_factor * iqrupper_extreme = q3 + extreme_factor * iqrlower_outlier = q1 - outlier_factor * iqrupper_outlier = q3 + outlier_factor * iqrextremes = column[(column < lower_extreme) | (column > upper_extreme)]outliers = column[(column < lower_outlier) | (column > upper_outlier)]return len(extremes), len(outliers)for col in df.columns:col_data = df[col]dtype = col_data.dtypeif np.issubdtype(dtype, np.number):max_value = col_data.max()min_value = col_data.min()mean_value = col_data.mean()std_value = col_data.std()var_value = col_data.var()median_value = col_data.median()kurtosis_value = col_data.kurt()skew_value = col_data.skew()extreme_count, outlier_count = detect_extremes_and_outliers(col_data)else:max_value = min_value = mean_value = std_value = var_value = median_value = kurtosis_value = skew_value = Noneextreme_count = outlier_count = Nonenon_null_count = col_data.count()null_count = col_data.isna().sum()mode_value = col_data.mode().iloc[0] if not col_data.mode().empty else Nonetrue_count = col_data[col_data == True].count() if dtype == 'bool' else Nonefalse_count = col_data[col_data == False].count() if dtype == 'bool' else Nonenew_row = pd.DataFrame({'列名': [col],'数据类型': [dtype],'最大值': [max_value],'最小值': [min_value],'平均值': [mean_value],'非空值数量': [non_null_count],'空值数量': [null_count],'众数': [mode_value],'True数量': [true_count],'False数量': [false_count],'标准差': [std_value],'方差': [var_value],'中位数': [median_value],'峰度': [kurtosis_value],'偏度': [skew_value],'极值数量': [extreme_count],'异常值数量': [outlier_count]})stats_df = pd.concat([stats_df, new_row], ignore_index=True)print(stats_df)
>> 列名     数据类型     最大值    最小值  ...         峰度        偏度  极值数量 异常值数量
0               gender   object     NaN    NaN  ...        NaN       NaN  None  None
1                  age  float64   80.00   0.08  ...  -1.003835 -0.051979     0     0
2         hypertension    int64    1.00   0.00  ...   8.441441  3.231296  7485  7485
3        heart_disease    int64    1.00   0.00  ...  20.409952  4.733872  3942  3942
4      smoking_history   object     NaN    NaN  ...        NaN       NaN  None  None
5                  bmi  float64   95.69  10.01  ...   3.520772  1.043836  1258    46
6          HbA1c_level  float64    9.00   3.50  ...   0.215392 -0.066854     0     0
7  blood_glucose_level    int64  300.00  80.00  ...   1.737624  0.821655     0     0
8             diabetes    int64    1.00   0.00  ...   6.858005  2.976217  8500  8500for col in df.columns:plt.figure(figsize=(10, 6))df[col].dropna().hist(bins=30)plt.title(f"{col} - 数据分布图")plt.ylabel("频率")timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')file_name = f"{col}_数据分布图_{timestamp}.png"file_path = os.path.join(output_dir, file_name)plt.savefig(file_path)plt.close()grouped_data = df.groupby('smoking_history')['diabetes'].count()
plt.figure(figsize=(8, 8))
plt.pie(grouped_data, labels=grouped_data.index, autopct='%1.1f%%', startangle=90, colors=plt.cm.Paired.colors)
plt.title("饼状图\n维饼状图", fontsize=16)
plt.axis('equal')
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
file_name = f"smoking_history_diabetes_distribution_{timestamp}.png"
file_path = os.path.join(output_dir, file_name)
plt.savefig(file_path)
plt.close() 

在这里插入图片描述
在这里插入图片描述
2、Implementation of Sentosa_DSML Community Edition

  First, perform data input by directly reading the data using a text operator and selecting the data path,
在这里插入图片描述
  Next, the description operator can be utilized to perform statistical analysis on the data, obtaining results such as the data distribution diagram, extreme values, and outliers for each column of data. Connect the description operator, and set the extreme value multiplier to 3 and the outlier multiplier to 6 on the right side.
在这里插入图片描述
  After clicking execute, the results of data statistical analysis can be obtained.
在这里插入图片描述
  You can also connect graph operators, such as pie charts, to make statistics on the relationship between different smoking histories and diabetes,
在这里插入图片描述
  The results obtained are as follows:在这里插入图片描述

(2)Data preprocessing

1、Implementation in Python code

df_filtered = df[df['gender'] != 'Other']
if df_filtered.empty:raise ValueError(" `gender`='Other'")
else:print(df_filtered.head())if 'Partition_Column' in df.columns:df['Partition_Column'] = df['Partition_Column'].astype('category')df = pd.get_dummies(df, columns=['gender', 'smoking_history'], drop_first=True)X = df.drop(columns=['diabetes'])
y = df['diabetes']X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1, random_state=42)

2、Implementation of Sentosa_DSML Community Edition
  Connect the filtering operator after the text operator, with the filtering condition of ‘gender’=‘Other’, without retaining the filtering term, that is, filtering out data with a value of ‘Other’ in the ‘gender’ column.
在这里插入图片描述
  Connect the sample partitioning operator, divide the training set and test set ratio,
在这里插入图片描述
Then, connect the type operator to display the storage type, measurement type, and model type of the data, and set the model type of the diabetes column to Label.
在这里插入图片描述

(3)Model Training and Evaluation

1、Implementation in Python code

dtrain = xgb.DMatrix(X_train, label=y_train, enable_categorical=True)params = {'n_estimators': 300,'learning_rate': 0.3,'min_split_loss': 0,'max_depth': 30,'min_child_weight': 1,'subsample': 1,'colsample_bytree': 0.8,'lambda': 1,'alpha': 0,'objective': 'binary:logistic','eval_metric': 'logloss','missing': np.nan
}xgb_model = xgb.XGBClassifier(**params, use_label_encoder=False)
xgb_model.fit(X_train, y_train, eval_set=[(X_test, y_test)], verbose=True)y_train_pred = xgb_model.predict(X_train)
y_test_pred = xgb_model.predict(X_test)def evaluate_model(y_true, y_pred, dataset_name=''):accuracy = accuracy_score(y_true, y_pred)weighted_precision = precision_score(y_true, y_pred, average='weighted')weighted_recall = recall_score(y_true, y_pred, average='weighted')weighted_f1 = f1_score(y_true, y_pred, average='weighted')print(f"评估结果 - {dataset_name}")print(f"准确率 (Accuracy): {accuracy:.4f}")print(f"加权精确率 (Weighted Precision): {weighted_precision:.4f}")print(f"加权召回率 (Weighted Recall): {weighted_recall:.4f}")print(f"加权 F1 分数 (Weighted F1 Score): {weighted_f1:.4f}\n")return {'accuracy': accuracy,'weighted_precision': weighted_precision,'weighted_recall': weighted_recall,'weighted_f1': weighted_f1}train_eval_results = evaluate_model(y_train, y_train_pred, dataset_name='训练集 (Training Set)')
>评估结果 - 训练集 (Training Set)
准确率 (Accuracy): 0.9991
加权精确率 (Weighted Precision): 0.9991
加权召回率 (Weighted Recall): 0.9991
加权 F1 分数 (Weighted F1 Score): 0.9991test_eval_results = evaluate_model(y_test, y_test_pred, dataset_name='测试集 (Test Set)')>评估结果 - 测试集 (Test Set)
准确率 (Accuracy): 0.9657
加权精确率 (Weighted Precision): 0.9641
加权召回率 (Weighted Recall): 0.9657
加权 F1 分数 (Weighted F1 Score): 0.9643

Evaluate the performance of classification models on the test set by plotting ROC curves.

def save_plot(filename):timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')file_path = os.path.join(output_dir, f"{filename}_{timestamp}.png")plt.savefig(file_path)plt.close()def plot_roc_curve(model, X_test, y_test):"""绘制ROC曲线"""y_probs = model.predict_proba(X_test)[:, 1]fpr, tpr, thresholds = roc_curve(y_test, y_probs)roc_auc = auc(fpr, tpr)plt.figure(figsize=(10, 6))plt.plot(fpr, tpr, color='blue', label='ROC 曲线 (area = {:.2f})'.format(roc_auc))plt.plot([0, 1], [0, 1], color='red', linestyle='--')plt.xlabel('假阳性率 (FPR)')plt.ylabel('真正率 (TPR)')plt.title('Receiver Operating Characteristic (ROC) 曲线')plt.legend(loc='lower right')save_plot("ROC曲线")plot_roc_curve(xgb_model, X_test, y_test)

在这里插入图片描述
2、Implementation of Sentosa_DSML Community Edition
  After preprocessing is completed, connect the XGBoost classification operator and configure the operator properties on the right side. In the operator properties, the evaluation metric is the loss function of the algorithm, which includes logarithmic loss and classification error rate; Learning rate, maximum depth of the tree, minimum leaf node sample weight sum, subsampling rate, minimum splitting loss, proportion of randomly sampled columns per tree, L1 regularization term and L2 regularization term are all used to prevent algorithm overfitting. When the sum of the weights of the sub node samples is not greater than the set minimum sum of the weights of the leaf node samples, the node will not be further divided. The minimum splitting loss specifies the minimum decrease in the loss function required for node splitting. When the tree construction method is hist, three attributes need to be configured: node mode, maximum number of boxes, and single precision.
 & emsp; In this case, the attribute configuration in the classification model is as follows: iteration number: 300, learning rate: 0.3, minimum splitting loss: 0, maximum depth of number: 30, minimum leaf node sample weight sum: 1, subsampling rate: 1, tree construction algorithm: auto, proportion of randomly sampled columns per tree: 0.8, L2 regularization term: 1, L1 regularization term: 0, evaluation metric is logarithmic loss, initial prediction score is 0.5, and the confusion matrix between feature importance and training data is calculated.
在这里插入图片描述
  Right click to execute to obtain the XGBoost classification model.
在这里插入图片描述
  By connecting the evaluation operator and ROC-AUC evaluation operator after the classification model, the prediction results of the model’s training and testing sets can be evaluated.
在这里插入图片描述
在这里插入图片描述
  Evaluate the performance of the model on the training and testing sets, mainly using accuracy, weighted precision, weighted recall, and weighted F1 score. The results are as follows:
在这里插入图片描述
在这里插入图片描述
  The ROC-AUC operator is used to evaluate the correctness of the classification model trained on the current data, display the ROC curve and AUC value of the classification results, and evaluate the classification performance of the model. The execution result is as follows:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
  The table operator in chart analysis can also be used to output model data in tabular form.
在这里插入图片描述
  The execution result of the table operator is as follows:
在这里插入图片描述

(4)Model visualization

1、Implementation in Python code

def save_plot(filename):timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')file_path = os.path.join(output_dir, f"{filename}_{timestamp}.png")plt.savefig(file_path)plt.close()def plot_confusion_matrix(y_true, y_pred):confusion = confusion_matrix(y_true, y_pred)plt.figure(figsize=(8, 6))sns.heatmap(confusion, annot=True, fmt='d', cmap='Blues')plt.title("混淆矩阵")plt.xlabel("预测标签")plt.ylabel("真实标签")save_plot("混淆矩阵")def print_model_params(model):params = model.get_params()print("模型参数:")for key, value in params.items():print(f"{key}: {value}")def plot_feature_importance(model):plt.figure(figsize=(12, 8))xgb.plot_importance(model, importance_type='weight', max_num_features=10)plt.title('特征重要性图')plt.xlabel('特征重要性 (Weight)')plt.ylabel('特征')save_plot("特征重要性图")print_model_params(xgb_model)
plot_feature_importance(xgb_model)

在这里插入图片描述
2、Implementation of Sentosa_DSML Community Edition
  Right click to view model information to display model results such as feature importance maps, confusion matrices, decision trees, etc.
在这里插入图片描述
  The model information is as follows:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
  Through connection operators and configuration parameters, the whole process of diabetes classification prediction based on XGBoost algorithm is completed, from data import, pre-processing, model training to prediction and performance evaluation. Through the model evaluation operator, we can know the accuracy, recall rate, F1 score and other key evaluation indicators of the model in detail, so as to judge the performance of the model in the diabetes classification task.

3、summarize

 & emsp; Compared to traditional coding methods, using Sentosa_SSML Community Edition to complete the process of machine learning algorithms is more efficient and automated. Traditional methods require manually writing a large amount of code to handle data cleaning, feature engineering, model training, and evaluation. In Sentosa_SSML Community Edition, these steps can be simplified through visual interfaces, pre built modules, and automated processes, effectively reducing technical barriers. Non professional developers can also develop applications through drag and drop and configuration, reducing dependence on professional developers.
 & emsp; Sentosa_SSML Community Edition provides an easy to configure operator flow, reducing the time spent writing and debugging code, and improving the efficiency of model development and deployment. Due to the clearer structure of the application, maintenance and updates become easier, and the platform typically provides version control and update features, making continuous improvement of the application more convenient.

Sentosa Data Science and Machine Learning Platform (Sentosa_DSML) is a one-stop AI development, deployment, and application platform with full intellectual property rights owned by Liwei Intelligent Connectivity. It supports both no-code “drag-and-drop” and notebook interactive development, aiming to assist customers in developing, evaluating, and deploying AI algorithm models through low-code methods. Combined with a comprehensive data asset management model and ready-to-use deployment support, it empowers enterprises, cities, universities, research institutes, and other client groups to achieve AI inclusivity and simplify complexity.

The Sentosa_DSML product consists of one main platform and three functional platforms: the Data Cube Platform (Sentosa_DC) as the main management platform, and the three functional platforms including the Machine Learning Platform (Sentosa_ML), Deep Learning Platform (Sentosa_DL), and Knowledge Graph Platform (Sentosa_KG). With this product, Liwei Intelligent Connectivity has been selected as one of the “First Batch of National 5A-Grade Artificial Intelligence Enterprises” and has led important topics in the Ministry of Science and Technology’s 2030 AI Project, while serving multiple “Double First-Class” universities and research institutes in China.

To give back to society and promote the realization of AI inclusivity for all, we are committed to lowering the barriers to AI practice and making the benefits of AI accessible to everyone to create a smarter future together. To provide learning, exchange, and practical application opportunities in machine learning technology for teachers, students, scholars, researchers, and developers, we have launched a lightweight and completely free Sentosa_DSML Community Edition software. This software includes most of the functions of the Machine Learning Platform (Sentosa_ML) within the Sentosa Data Science and Machine Learning Platform (Sentosa_DSML). It features one-click lightweight installation, permanent free use, video tutorial services, and community forum exchanges. It also supports “drag-and-drop” development, aiming to help customers solve practical pain points in learning, production, and life through a no-code approach.

This software is an AI-based data analysis tool that possesses capabilities such as mathematical statistics and analysis, data processing and cleaning, machine learning modeling and prediction, as well as visual chart drawing. It empowers various industries in their digital transformation and boasts a wide range of applications, with examples including the following fields:
1.Finance: It facilitates credit scoring, fraud detection, risk assessment, and market trend prediction, enabling financial institutions to make more informed decisions and enhance their risk management capabilities.
2.Healthcare: In the medical field, it aids in disease diagnosis, patient prognosis, and personalized treatment recommendations by analyzing patient data.
3.Retail: By analyzing consumer behavior and purchase history, the tool helps retailers understand customer preferences, optimize inventory management, and personalize marketing strategies.
4.Manufacturing: It enhances production efficiency and quality control by predicting maintenance needs, optimizing production processes, and detecting potential faults in real-time.
5.Transportation: The tool can optimize traffic flow, predict traffic congestion, and improve transportation safety by analyzing transportation data.
6.Telecommunications: In the telecommunications industry, it aids in network optimization, customer behavior analysis, and fraud detection to enhance service quality and user experience.
7.Energy: By analyzing energy consumption patterns, the software helps utilities optimize energy distribution, reduce waste, and improve sustainability.
8.Education: It supports personalized learning by analyzing student performance data, identifying learning gaps, and recommending tailored learning resources.
9.Agriculture: The tool can monitor crop growth, predict harvest yields, and detect pests and diseases, enabling farmers to make more informed decisions and improve crop productivity.
10.Government and Public Services: It aids in policy formulation, resource allocation, and crisis management by analyzing public data and predicting social trends.

Welcome to the official website of the Sentosa_DSML Community Edition at https://sentosa.znv.com/. Download and experience it for free. Additionally, we have technical discussion blogs and application case shares on platforms such as Bilibili, CSDN, Zhihu, and cnBlog. Data analysis enthusiasts are welcome to join us for discussions and exchanges.

Sentosa_DSML Community Edition: Reinventing the New Era of Data Analysis. Unlock the deep value of data with a simple touch through visual drag-and-drop features. Elevate data mining and analysis to the realm of art, unleash your thinking potential, and focus on insights for the future.

Official Download Site: https://sentosa.znv.com/
Official Community Forum: http://sentosaml.znv.com/
GitHub:https://github.com/Kennethyen/Sentosa_DSML
Bilibili: https://space.bilibili.com/3546633820179281
CSDN: https://blog.csdn.net/qq_45586013?spm=1000.2115.3001.5343
Zhihu: https://www.zhihu.com/people/kennethfeng-che/posts
CNBlog: https://www.cnblogs.com/KennethYuen

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

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux(CentOS)安装达梦数据库 dm8

CentOS版本&#xff1a;CentOS 7&#xff0c;查看操作系统版本信息&#xff0c;请查阅 查看Linux内核版本信息 达梦数据库版本&#xff1a;dm8 一、获取 dm8 安装文件 1、下载安装文件 打开达梦官网&#xff1a;https://www.dameng.com/ 下载的文件 解压后的文件 2、上传安…

ReactPress与WordPress:两大开源发布平台的对比与选择

ReactPress与WordPress&#xff1a;两大开源发布平台的对比与选择 在当今数字化时代&#xff0c;内容管理系统&#xff08;CMS&#xff09;已成为各类网站和应用的核心组成部分。两款备受欢迎的开源发布平台——ReactPress和WordPress&#xff0c;各自拥有独特的优势和特点&am…

前后端请求响应

引入 在之前的例子中&#xff0c;我们编写了一个简单的web类&#xff0c;我们运行启动类&#xff0c;启动内嵌的tomcat后就可以在浏览器通过特定的路径访问tomcat中的应用程序。 但之前编写的程序仅仅是个简单的java类&#xff0c;其并未实现某个接口或继承某个类&…

Ubuntu24 上安装搜狗输入法

link 首先在终端中依次输入以下代码 sudo apt update sudo apt install fcitx 找到语言支持 在终端中依次输入 sudo cp /usr/share/applications/fcitx.desktop /etc/xdg/autostart/ sudo apt purge ibus 进入网页 搜狗输入法linux-首页​ shurufa.sogou.com/linux 找到刚才下…

Linux从0——1之shell编程4

声明&#xff01; 学习视频来自B站up主 **泷羽sec** 有兴趣的师傅可以关注一下&#xff0c;如涉及侵权马上删除文章&#xff0c;笔记只是方便各位师傅的学习和探讨&#xff0c;文章所提到的网站以及内容&#xff0c;只做学习交流&#xff0c;其他均与本人以及泷羽sec团队无关&a…

嵌入式硬件杂谈(二)-芯片输入接入0.1uf电容的本质(退耦电容)

引言&#xff1a;对于嵌入式硬件这个庞大的知识体系而言&#xff0c;太多离散的知识点很容易疏漏&#xff0c;因此对于这些容易忘记甚至不明白的知识点做成一个梳理&#xff0c;供大家参考以及学习&#xff0c;本文主要针对芯片输入接入0.1uf电容的本质的知识点的进行学习。 目…

树莓派4B Qt+FFMPEG 多线程录制USB相机mjpeg数据流“h264_omx“硬件编码的MP4文件

文章目录 1 前言2 一些问题说明2.0 树莓派4b系统版本2.1 Qt2.2 FFMPEG2.3 图像格式 3 核心代码3.0 代码逻辑3.1 pro文件3.2 avframequeue.cpp3.3 decodethread.cpp 4 资源下载 1 前言 本项目为在树莓派4B开发板上&#xff0c;通过QtFFMPEG以多线程分别解码、编码USB摄像头视频数…

Cartographer激光雷达slam -20241116

Cartographer Cartographer代码结构 cartographer&#xff1a;负责处理来自雷达、IMU和里程计的数据并基于这些数据进行地图的构建&#xff0c;是cartographer理论的底层实现cartographer_ros&#xff1a;基于ros的通信机制获取传感器的数据并将它们转换成cartographer中定义…

Scratch 014生日贺卡(上)

知识回顾&#xff1a; 1、“面向鼠标指针”积木块 2、“重复执行直到”积木块 本次分享制作生日贺卡引入广播模块 案列效果&#xff1a; 生日贺卡上案例效果-CSDN直播 步骤拆解&#xff1a; 1、添加背景和角色 2、编辑贺卡造型添加名字 3、流程图的组成和画法 4、…

外网访问 WebDav 服务

从外部网络环境&#xff08;比如异地和家中网络&#xff09;来访问公司内网的 WebDav 服务&#xff08;基于 IIS &#xff09;并映射成本地虚拟磁盘。 步骤如下 第一步 在公司内网的电脑上设置 webDav。 1&#xff0c;找到【控制面板】&#xff0c;双击进入。 2&#xff0c…

渑池县中药材产业党委莅临河南广宇企业管理集团有限公司参观交流

11月14日&#xff0c;渑池县人大副主任、工商联主席杨航率县中药材产业党委代表团一行13人&#xff0c;莅临河南广宇集团参观交流。河南广宇集团总经理王峰、副总经理王培等领导热情接待并陪同参观、座谈。 代表团一行首先参观了集团旗下郑州美信中医院&#xff08;庚贤堂中医药…

WP网站如何增加文章/页面的自定义模板

通过Wordpress我们后台在发布文章或者页面的时候其实可以看到有些主题 他有选择使用的页面模板&#xff0c;可以自定义模板&#xff0c;但是有些主题却没有选择主题这个功能&#xff0c;那这个自定义模板的功能是如何实现的呢&#xff1f;以下分两种情况&#xff1a;Page页面和…

FFmpeg 4.3 音视频-多路H265监控录放C++开发十四,总结编码过程,从摄像头获得数据后,转成AVFrame,然后再次转成AVPacket,

也就是将摄像头采集到的YUV 的数据换成 AVFrame&#xff0c;然后再次转成 AVPacket&#xff0c;那么这AVPakcet数据要怎么办呢&#xff1f;分为三种情况&#xff1a; 一种是将AVPacket存储成h264文件&#xff0c;由于h264编码器在将avframe变成avpacket的时候就是按照h264的格…

SQL Server 查询设置 - LIKE/DISTINCT/HAVING/排序

目录 背景 一、LIKE - 模糊查询 1. 通配符 % 2. 占位符 _ 3. 指定集合 [] 3.1 表示否定 ^ 3.2 表示范围 - 4. 否定 NOT 二、DISTINCT - 去重查询 三、HAVING - 过滤查询 四、小的查询设置 1. ASC|DESC - 排序 2. TOP - 限制 3. 子查询 4. not in - 取补集&…

动态规划-完全背包问题——322.零钱兑换

1.题目解析 题目来源 322.零钱兑换——力扣 测试用例 2.算法原理 1.状态表示 这里需要寻找硬币使总面值等于一个值求出所需硬币的最小个数&#xff0c;所以不妨设置一个二维dp表&#xff0c;即dp[i][j]&#xff1a;在[1,i]个硬币中选择的硬币总面值完全等于j时所需要的最小硬…

从零到一:利用 AI 开发 iOS App 《震感》的编程之旅

在网上看到一篇关于使用AI开发的编程经历&#xff0c;分享给大家 作者是如何在没有 iOS 开发经验的情况下&#xff0c;借助 AI&#xff08;如 Claude 3 模型&#xff09;成功开发并发布《震感》iOS 应用。 正文开始 2022 年 11 月&#xff0c;ChatGPT 诞生并迅速引发全球关注。…

【Linux庖丁解牛】—Linux基本指令(下)!

目录 1、grep指令 2、zip/unzip指令 3、sz/rz指令 4、tar指令 ​编辑 5、scp指令 6、bc指令 7、uname –r指令 8、重要的几个热键 9、关机 10、完结撒花 1、grep指令 grep是文本过滤器&#xff0c;其作用是在指定的文件中过滤出包含你指定字符串的内容&#xff0c;…

小程序19-微信小程序的样式和组件介绍

在小程序中不能使用 HTML 标签&#xff0c;也就没有 DOM 和 BOM&#xff0c;CSS 也仅支持部分选择器 小程序提供了 WXML 进行页面结构的编写&#xff0c;WXSS 进行页面的样式编写 WXML 提供了 view、text、image、navigator等标签构建页面结构&#xff0c;小程序中标签称为组件…

VMD + CEEMDAN 二次分解,CNN-LSTM预测模型

往期精彩内容&#xff1a; 时序预测&#xff1a;LSTM、ARIMA、Holt-Winters、SARIMA模型的分析与比较 全是干货 | 数据集、学习资料、建模资源分享&#xff01; EMD变体分解效果最好算法——CEEMDAN&#xff08;五&#xff09;-CSDN博客 拒绝信息泄露&#xff01;VMD滚动分…

《生成式 AI》课程 第3講 CODE TASK 任务3:自定义任务的机器人

课程 《生成式 AI》课程 第3講&#xff1a;訓練不了人工智慧嗎&#xff1f;你可以訓練你自己-CSDN博客 我们希望你创建一个定制的服务机器人。 您可以想出任何您希望机器人执行的任务&#xff0c;例如&#xff0c;一个可以解决简单的数学问题的机器人0 一个机器人&#xff0c…