【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.mzph.cn/diannao/60562.shtml

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

相关文章

Rust Struct 属性初始化

结构体是用户定义的数据类型&#xff0c;其中包含定义特定实例的字段。结构有助于实现更容易理解的抽象概念。本文介绍几种初始化结构体对象的方法&#xff0c;包括常规方法、Default特征、第三方包实现以及构建器模式。 Struct声明与初始化 struct Employee {id: i32,name: …

AI大模型微调:Qwen2大模型微调入门实战(完整代码)

简介&#xff1a; 该教程介绍了如何使用Qwen2&#xff0c;一个由阿里云通义实验室研发的开源大语言模型&#xff0c;进行指令微调以实现文本分类。微调是通过在&#xff08;指令&#xff0c;输出&#xff09;数据集上训练来改善LLMs理解人类指令的能力。教程中&#xff0c;使用…

基于Python+Django+Vue3+MySQL实现的前后端分类的商场车辆管理系统

项目名称&#xff1a;基于PythonDjangoVue3MySQL实现的前后端分离商场车辆管理系统 技术栈 开发工具&#xff1a;PyCharm、Visual Studio Code (VSCode)运行环境&#xff1a;Python 3.10、MySQL 8.0、Node.js 18技术框架&#xff1a;Django 5、Vue 3.4、Ant-Design-Vue 4.12 …

C++初阶:类和对象(上)

1. 类的定义 1.1 类的定义格式 class为定义类的关键字&#xff0c;Stack为类的名字&#xff0c;{ } 中为类的主体&#xff0c;注意类定义结束后的分号不能省略。类体中的内容为类的成员&#xff1a;类中的变量称为类的属性或成员变量&#xff1b;类中的函数称为类的方法或成员…

ctfshow DSBCTF web部分wp

ctfshow 单身杯 web部分wp web 签到好玩的PHP 源码&#xff1a; <?php error_reporting(0); highlight_file(__FILE__);class ctfshow {private $d ;private $s ;private $b ;private $ctf ;public function __destruct() {$this->d (string)$this->d;$this…

【分布式】万字图文解析——深入七大分布式事务解决方案

分布式事务 分布式事务是指跨多个独立服务或系统的事务管理&#xff0c;以确保这些服务中的数据变更要么全部成功&#xff0c;要么全部回滚&#xff0c;从而保证数据的一致性。在微服务架构和分布式系统中&#xff0c;由于业务逻辑往往会跨多个服务&#xff0c;传统的单体事务…

边缘计算在智能物流中的应用

&#x1f493; 博客主页&#xff1a;瑕疵的CSDN主页 &#x1f4dd; Gitee主页&#xff1a;瑕疵的gitee主页 ⏩ 文章专栏&#xff1a;《热点资讯》 边缘计算在智能物流中的应用 边缘计算在智能物流中的应用 边缘计算在智能物流中的应用 引言 边缘计算概述 定义与原理 发展历程 …

Spring Boot框架:电商开发的新趋势

5 系统实现 系统实现部分就是将系统分析&#xff0c;系统设计部分的内容通过编码进行功能实现&#xff0c;以一个实际应用系统的形式展示系统分析与系统设计的结果。前面提到的系统分析&#xff0c;系统设计最主要还是进行功能&#xff0c;系统操作逻辑的设计&#xff0c;也包括…

本地源配置 以及ssh 和 nfs

安装软件的三种方式 apt 仓库 在/etc/apt/sources.list文件下 在线源 离线包 修改离线包 挂载并更新 ssh远程管理 sshd的配置文件 服务器命令行的远程登录方式 远程复制 先在第一台主机上创建文件 使用scp命令复制 sftp ssh的密钥登录 创建rsa密钥 将密钥文件传给另一台主机…

JavaWeb:文件上传1

欢迎来到“雪碧聊技术”CSDN博客&#xff01; 在这里&#xff0c;您将踏入一个专注于Java开发技术的知识殿堂。无论您是Java编程的初学者&#xff0c;还是具有一定经验的开发者&#xff0c;相信我的博客都能为您提供宝贵的学习资源和实用技巧。作为您的技术向导&#xff0c;我将…

【MMIN】缺失模态想象网络用于不确定缺失模态的情绪识别

代码地址&#xff1a;https://github.com/AIM3RUC/MMIN abstract&#xff1a; 在以往的研究中&#xff0c;多模态融合已被证明可以提高情绪识别的性能。然而&#xff0c;在实际应用中&#xff0c;我们经常会遇到模态丢失的问题&#xff0c;而哪些模态会丢失是不确定的。这使得…

图像处理实验四(Adaptive Filter)

一、Adaptive Filter简介 自适应滤波器&#xff08;Adaptive Filter&#xff09;是一种能够根据输入信号的统计特性自动调整自身参数以达到最佳滤波效果的滤波器。它广泛应用于信号处理领域&#xff0c;如信道均衡、系统识别、声学回波抵消、生物医学、雷达、波束形成等模块。 …

深入理解AIGC背后的核心算法:GAN、Transformer与Diffusion Models

深入理解AIGC背后的核心算法&#xff1a;GAN、Transformer与Diffusion Models 前言 随着人工智能技术的发展&#xff0c;AIGC&#xff08;AI Generated Content&#xff0c;人工智能生成内容&#xff09;已经不再是科幻电影中的幻想&#xff0c;而成为了现实生活中的一种新兴力…

【STM32】基于SPI协议读写SD,详解!

文章目录 0 前言1 SD卡的种类和简介1.1 SD卡的种类1.2 SD卡的整体结构1.3 SD卡运行机制——指令和响应2 SD卡的通信总线2.1 SDIO2.2 SPI3 硬件连接4 代码实践【重点】4.1 HAL库移植4.2 标准库移植4.3 遇到的问题和解决方案5 扩展阅读0 前言 因为项目需要,使用stm32读写sd卡,这…

Three.js 纹理贴图

1. 纹理贴图 在Three.js中&#xff0c;纹理贴图是一种将二维图像贴到三维物体表面的技术&#xff0c;以增强物体的视觉表现。纹理贴图可以使物体表面更加真实、细腻&#xff0c;为场景增色不少。 在Three.js中&#xff0c;纹理贴图的加载主要通过THREE.TextureLoader类实现。…

ArcGIS Pro属性表乱码与字段名3个汉字解决方案大总结

01 背景 我们之前在使用ArcGIS出现导出Excel中文乱码及shp添加字段3个字被截断的情况&#xff0c;我们有以下应对策略&#xff1a; 推荐阅读&#xff1a;ArcGIS导出Excel中文乱码及shp添加字段3个字被截断&#xff1f; 那如果我们使用ArGIS Pro出现上述问题&#xff0c;该如何…

图论-代码随想录刷题记录[JAVA]

文章目录 前言Floyd 算法dijkstra&#xff08;朴素版&#xff09; 前言 新手小白记录第一次刷代码随想录 1.自用 抽取精简的解题思路 方便复盘 2.代码尽量多加注释 3.记录踩坑 4.边刷边记录&#xff0c;更有成就感&#xff01; 5.解题思路绝大部分来自代码随想录 Floyd 算法 【…

anzocapital 昂首资本:外汇机器人趋势判断秘籍

再盲目交易而不借助像 anzocapital 昂首资本所了解的外汇机器人趋势判断方法&#xff0c;投资者在外汇市场将面临亏损的风险&#xff0c;anzocapital 昂首资本深知交易策略的重要性&#xff0c;就像外汇机器人确定趋势方向的方法&#xff0c;对投资者有着非凡的意义。 在外汇交…

【划分型DP-约束划分个数】【hard】力扣410. 分割数组的最大值

给定一个非负整数数组 nums 和一个整数 k &#xff0c;你需要将这个数组分成 k 个非空的连续子数组&#xff0c;使得这 k 个子数组各自和的最大值 最小。 返回分割后最小的和的最大值。 子数组 是数组中连续的部份。 示例 1&#xff1a; 输入&#xff1a;nums [7,2,5,10,8]…

python高级之面向对象编程

一、面向过程与面向对象 面向过程和面向对象都是一种编程方式&#xff0c;只不过再设计上有区别。 1、面向过程pop&#xff1a; 举例&#xff1a;孩子上学 1. 妈妈起床 2. 妈妈洗漱 3. 妈妈做饭 4. 妈妈把孩子叫起来 5. 孩子起床 6. 孩子洗漱 7. 孩子吃饭 8. 妈妈给孩子送学校…