什么是数据预处理

人工智能35

什么是数据预处理


你好,这篇文章咱们讨论一下关于「什么是数据预处理」的事情...

数据预处理

数据预处理是数据挖掘中的一个重要步骤,也是数据科学家的日常工作之一。数据预处理可以理解为将原始数据转化为可用于分析和建模的数据。它通常包括数据清洗、数据集成、数据变换和数据规约四个方面。本文将对这些方面进行详细介绍。

数据清洗

数据清洗是指对原始数据进行审核、纠正、更新和删除,使其符合数据分析的要求。数据清洗主要包括以下几个步骤:

  • 缺失值处理。缺失值是指数据表中某些变量缺少值的情况。处理方法可以是删除包含缺失值的行、填补缺失值或者使用插值法。
  • 重复值处理。重复值是指在数据表中存在重复的记录。处理方法可以是删除重复的记录或者合并重复的记录。
  • 异常值处理。异常值是指数据表中一些与其他变量值差异很大的值。处理方法可以是直接删除或进行修正。
  • 不一致数据处理。不一致数据是指数据表中的一些不一致或者对立的数据。处理方法可以是数据清洗或者数据转化。

数据集成

数据集成是将来自不同数据源的数据合并成一个数据集的过程。在数据集成过程中需要解决数据冗余和数据不一致的问题,这要求数据集成的方法需要考虑数据的粒度和数据集成之间的映射。数据集成的主要技术包括:

  • 数据仓库技术。数据仓库是指一个面向主题的、集成的、历史的数据集合,通过对数据进行加工、集成和聚合等操作,来满足企业决策管理的需要。

  • OLAP技术。OLAP是在线分析处理的缩写,通过支持多维分析、查询速度快、数据实时性高等优点,可以满足复杂业务决策的需求。

数据变换

数据变换是指对数据进行格式化和规范化的过程。数据变换主要包括以下几个方面:

  • 数据编码。数据编码是指将阿拉伯数字、日期、公历日期等数据格式化处理成为某种标准格式的数据。

  • 数据聚合。数据聚合是指将大量数据汇集起来,通过数据加工、挖掘和分析等操作来从中提取有用的信息,以支持企业的决策制定。

  • 数据萃取。数据萃取是指在大量数据中从中筛选出关键信息的过程。数据萃取可以实现对数据的聚焦,减少冗余数据的影响。

  • 特征工程。特征工程是数据挖掘中的一种数据变换技术,它可以提取数据的潜在特征,并将这些特征转换为有意义的数据模型以支持新的分析工作。

数据规约

数据规约是指将数据集中的特征和属性转化为更少的属性,以减少数据集的大小和复杂性。数据规约的方法主要包括以下几个方面:

  • 维度规约。维度规约是指将数据集中的不相关或者无用的维度删除或压缩,以减小数据集的维度。

  • 属性规约。属性规约是指将数据集中的某些属性或者属性值进行删除或压缩,以减少数据集的大小。属性规约主要包括前向选择、后向选择、PCA、LDA等技术。

  • 目标规约。目标规约是指在保持数据集性能不变的情况下,减少数据集的大小。这通常使用包含关键词的标记或者索引的方法实现。

总结

本文介绍了数据预处理的主要内容,包括数据清洗、数据集成、数据变换和数据规约四个方面。在实际工作中,数据预处理是数据科学家必须要掌握的技能,这是因为只有经过积极、科学的数据预处理,才能为后续的数据挖掘、模型构建等工作奠定基础。数据预处理决定了最终的分析结果。因此,无论是数据采集、还是数据处理,都必须十分注重数据质量,致力于提出高质量的数据集,才能实现准确的结果。

大家都在看:

机器学习——聚类算法简单汇总

聚类是机器学习中典型的无监督学习,也是一个重要的数据挖掘方法。

[En]

Clustering is not only a typical unsupervised learning in machine learning, but also an important data mining method.

基本原理:根据规则划分,把样本相似度高的聚在同一类,把样本相似度低的聚在同一类。使得组内相似性大,组间相似性小,也就是"高内聚,低耦合"。

应用:笔者本文里讲述的基于密度的聚类算法可以用于人脸识别、医学图像分割、疫情封控区、管控区的划分。而本文案例是一种基于密度聚类算法的空间聚类运用,可以运用在城市规划中,使用空间聚类可以分析各种服务设施的作用以及服务区域,以帮助城市到达最佳规划。

常见有五种聚类算法及其优缺点:

⑴ 基于空间划分的聚类算法 :

首先给定一个最终需要的聚类数目,在数据集中区域主观选取初始的聚类中心,通过更换质心为新的聚类中心的方法不断进行聚类的更新,直到数据集被划分为预先指定数目的聚类个数。该算法只需要满足"类内的点要都足够得近,类间的点要都足够得远"的目标效果,也即正是根据我们所说的"启发式算法"。

[En]

First of all, given a final clustering number, the initial clustering center is subjectively selected in the region of the data set, and the clustering is constantly updated by changing the centroid to the new clustering center. until the dataset is divided into a pre-specified number of clusters. The algorithm only needs to meet the goal effect of "the points within the class should be close enough and the points between classes should be far enough", that is, according to what we call the "heuristic algorithm".

此方法原理最简单、空间复杂度和时间复杂度一般都很低但是聚类的效果却和初始参数是否正确选取是有很大的关系的,结果比较容易落入局部最优。对于噪声点和离群值不具有鲁棒性、非常的敏感且只适用于凸集。

[En]

The principle of this method is the simplest, and the space complexity and time complexity are generally very low, but the effect of clustering has a lot to do with the correct selection of the initial parameters, and the result is easy to fall into the local optimization. It is not robust to noise points and outliers, is very sensitive and is only suitable for convex sets.

(2)基于空间层次的聚类算法:

凝聚层次聚类算法是从底部往上进行运算的,将每一个数据库对象都单独划分作为其中某一个层次聚类簇,根据基于距离的计算方法将所有的相邻层次里的各个数据库对象都单独划分为同一个层次聚合簇,直到其全部被合并为其中某的一个簇或者全部达到算法所需设定好的聚合簇阈值范围后为止。分裂层次的聚类的方法是一种自由从顶向下进行的,将在一个数据库层域中存在的几乎所有的数据库对象的集合单独作为其中某的一个簇,再然后逐步的根据最大相异性原则来逐步对几乎所有的该库对象的簇集合逐个进行分解,直到最后使得每个数据库对象簇所集中起来的集合内只包含其中任意一个的数据库对象或达到算法所需设定的阈值后为止。凝聚层次聚类算法在和分裂层次聚类算法对于数据库层次树之间的关系的分割处理上不仅拥有了一种嵌套性关系,而且在整体结构层次上形象得形成了一种树状的结构。

[En]

The cohesion hierarchical clustering algorithm operates from the bottom up, and each database object is divided into one of the hierarchical clustering clusters separately. According to the distance-based calculation method, all the database objects in all adjacent levels are divided into the same hierarchical clustering cluster, until all of them are merged into one of the clusters or reach the threshold range set by the algorithm. The method of split hierarchical clustering is a free top-down method, which takes the collection of almost all database objects existing in a database layer domain as one of the clusters, and then decomposes almost all the cluster sets of the objects in the database step by step according to the principle of maximum dissimilarity. Until finally, the collection of each database object cluster contains only any one of the database objects or reaches the threshold set by the algorithm. The cohesive hierarchical clustering algorithm and the split hierarchical clustering algorithm not only have a nested relationship between the database hierarchical trees, but also form a tree-like structure on the overall structure level.

此方法可以清晰的看到类与类之间的层次关系,对于初始的聚类簇个数也不需要提前确定,并且也可以生成不同形状的聚类簇。但容易出现链状聚类并且计算复杂度高。

[En]

This method can clearly see the hierarchical relationship between classes, and the number of initial clusters does not need to be determined in advance, and clusters with different shapes can be generated. However, it is easy to appear chain clustering and has high computational complexity.

(3) 基于空间网格的聚类算法:

基本原理就是通过先将任何一个数据空间集合划分为任意一个大小可至数百个的网格单元,将所有各个数据对象集合都可以映射到每同一个网格单元进行集中,并能以此方法计算并得到所有每个网格单元数据集的空间密度。根据预先设定计算好的网格密度阈值来判断每个网格单元之间是不是构成一个相对高密度的网格单元,合并把相邻的相对稠密度的两个网格单元划分归为另一类。

[En]

The basic principle is that by dividing any set of data spaces into hundreds of grid cells, all sets of data objects can be mapped to each of the same grid cells for centralization. and the spatial density of all data sets of each grid cell can be calculated and obtained by this method. According to the pre-set grid density threshold to judge whether a relatively high-density grid cell is formed between each grid cell, the two adjacent grid elements with relatively dense density are divided into another category.

网格聚类算法的一大特色就是其计算速度快,无论数据量是多还是少,其计算速度都是一样的。因为他的计算速度不是由数据量决定而是由每一维的单元数决定的。网格结构更有利于数据并行化处理和数据增量快速更新,时间管理复杂度低。但聚类质量受网格划分的影响,对于低密度、不规则分布的数据库处理起来比较困难。

[En]

A major feature of grid clustering algorithm is its fast computing speed, regardless of whether the amount of data is large or small, its computing speed is the same. Because his computing speed is determined not by the amount of data but by the number of units in each dimension. Grid structure is more conducive to data parallelization and data incremental rapid update, and the complexity of time management is low. However, the clustering quality is affected by grid division, so it is difficult to deal with low-density and irregularly distributed databases.

(4) 基于空间模型的聚类算法:

每一个数据簇算法在数据进行数据聚类处理操作前首先都会事先给出一个假定的数据簇来自的是某种特定的模型,然后再逐步找到基于这些特定数据簇的对于其所事先指定好的特定模型可进行的各种算法最佳拟合。主要算法有可以分为以下这两类:一类通常都是直接采用一种基于概率模型的计算方法,如COBWEB算法、GMM 算法。一类方法是指基于神经网络模型的方法,如 SOM算法。以基于概率模型分析的统计方法的研究比较多,区别之于一般常见所谓的"启发式算法"方法,其一个基本理论思想也是指同一类模型的所有数据均属于同一的概率分布。

此算法使得概率数据清晰并且可视化程度高。算法用户还可以直接或根据这些概率数据在未来对于感兴趣的事件所在的特定区域上做出拟合或预测。但我们需要注意的是避免使用大数据样本信息模型去进行错误地预测。对于非凸集、密度不同的数据处理困难。

[En]

This algorithm makes the probability data clear and highly visible. The user of the algorithm can also fit or predict the specific area of the event of interest in the future directly or based on these probability data. But what we need to pay attention to is to avoid using big data's sample information model to make wrong predictions. It is difficult to process data with different densities and non-convex sets.

(5) 基于密度的聚类算法:

通常这种情况条件下,密度聚类算法的核心思想就是判断样本点是否为核心点的过程,密度相似的样本为一个聚类,不断扩充聚类直到所有除去噪声点的数据点都被划分到某一个聚类中。本文重点所说的DBSCAN聚类算法,其一个很主要的思想点则是认为只要每一个临近的给定的区域簇内的有效密度样本数目仍未持续超过或其接近某一个密度阀值时则都能对系统继续的进行密度聚类,即对于其临近的给定时域簇中存在的每个有效密度样本数在其某一个临近于给定时间范围簇内的区域簇中就一定必须同时并且至少又要同时包含着某一个密度阈值。

此算法不需要预先设定需要聚类的个数,不用担心离群值和噪声点对于聚类结果的影响,因为它可以检测出噪声点和离群值且可以生成任意形状的簇。但它不能很好地得反映高维的数据,难以适应密度极不稳定均匀分布的数据集、对输入参数异常敏感。

[En]

This algorithm does not need to set the number of clusters in advance, and does not have to worry about the influence of outliers and noise points on the clustering results, because it can detect noise points and outliers and generate clusters of arbitrary shape. However, it can not well reflect the high-dimensional data, it is difficult to adapt to the data set with extremely unstable and uniform distribution of density, and is extremely sensitive to input parameters.

Original: https://blog.csdn.net/qq_47250064/article/details/124725519
Author: chelsea_tongtong
Title: 机器学习——聚类算法简单汇总

相关文章
人工智能

gensim.models.word2vec() 参数详解

Word2vec是一个用来产生词向量的模型。是一个将单词转换成向量形式的工具。 通过转换,可以把对文本内容的处理简化为向量空间中的向量运算,计算出向量空间上的相似度,来表示文本语义上的相似度。 词向量...
人工智能

(十一)Canny 边缘检测算法

Canny边缘检测算法 一、边缘检测的步骤 1)滤波: 边缘检测的算法主要是基于图像强度的一阶和二阶导数,但导数通常对噪声很敏感, 因此必须采用滤波器来改善与噪声有关的边缘检测器的性能。常见的滤波方法...
人工智能

什么是3D建模?

将所见所想用立体三维的方式通过计算机技术表现出来,这就是3D建模,比如你看到了一个可爱呆萌的卡通人物又或是华丽酷炫的变形金刚,总之就是你认为美好的立体实物 你想将它用计算机技术完美的呈现出来,就要必须...
人工智能

家庭智能控制系统开发

前面发文讲嵌入式系统开发,学以致用,最近开发就开发一套最简单的嵌入式智能家庭控制系统。有人觉得购买现成的智能系统不是很好吗,我觉得不靠谱,比如个人信息安全问题,多个系统整合难问题,反正闲着自己做一套家...