版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
2024数据清洗DataCleaning主讲教师:XXX日期:2024.01.01目
录
CONTENT010302残缺数据清洗Incompletedatacleaning错误数据清洗Errordatacleaning重复数据清洗Duplicatedatacleaning跨境电子商务专业Cross-BorderE-CommerceMajor01残缺数据清洗Incompletedatacleaning跨境电子商务专业Cross-BorderE-CommerceMajor数据清洗的概念ConceptofDataCleaning
数据清洗是指将数据表中多余、重复的数据筛选出来并删除,将缺失、不完整的数据补充填补,将内容、格式错误的数据纠正或剔除的操作行为。数据清洗是对数据进行重新审查和校验的过程,目的在于提升数据的质量,确保数据的准确性、完整性和一致性。Datacleaningreferstotheoperationalpracticeoffilteringoutanddeletingredundantandduplicatedatafromdatatables,supplementingmissingorincompletedata,andcorrectingorremovingdatawitherroneouscontentorformatting.Datacleaningistheprocessofre-examiningandvalidatingdata,aimedatimprovingdataqualityandensuringdataaccuracy,completeness,andconsistency.缺失值清洗MissingValueCleaning异常值清洗OutlierCleaning重复数据清洗DuplicateDataCleaning无价值数据清洗Non-ValuableDataCleaning逻辑错误清洗LogicalErrorCleaning残缺值清洗IncompleteValueCleaning行记录缺失Missingrowrecords数据列值缺失Missingcolumnvalues由于各种原因导致的数据记录中某些列的值空缺Somecolumnvaluesindatarecordsarevacantduetovariousreasons.这种情况又称为记录丢失Thisconditionisalsoknownasrecordloss.数据缺失情况分类ClassificationofDataMissingScenarios值得注意的是,在极少数状态下,缺失值也会使用空字符串来代替,但空字符串绝对不同于缺失值,Itisworthnotingthatinrarecases,missingvaluesmayalsoberepresentedbyemptystrings,butemptystringsareabsolutelydifferentfrommissingvalues.数据集中某个或某些属性的值是不完整的。Thevaluesofoneormoreattributesinthedatasetareincomplete.产生原因Causesofoccurrence残缺值清洗IncompleteValueCleaningA有些信息无法获取,如在收集顾客婚姻状况和工作信息时,未婚人士的配偶、未成年儿童的工作单位等都是无法获取的信息。Certaininformationisunavailable.Forinstance,whencollectingcustomers'maritalstatusandemploymentdetails,datasuchasspousesofunmarriedindividualsandworkunitsofminorscannotbeobtained.B人为原因导致的某些信息被遗漏或删除Certaininformationisomittedordeletedduetohumanerror.C数据收集或者保存失败造成数据缺失,如数据存储的失败、存储器损坏、机械故障等。Datamissingarisingfromfaileddatacollectionorstorage,includingstoragebreakdown,storagemediumdamageandmechanicalfaults.残缺值清洗IncompleteValueCleaning对于残缺数据的清洗,常用的方法有4个:Therearefourcommonlyusedmethodsforcleaningincompletedata:补全残缺数据CompletingIncompleteData不做处理NoProcessing真值转换法TruthValueConversionMethod丢弃残缺数据DiscardingIncompleteData01020304残缺值清洗IncompleteValueCleaning直接删除带有缺失值的行记录或者列字段,减少趋势数据记录对总体数据的影响。Directlydeleterowrecordsorcolumnfieldswithmissingvaluestoreducetheimpactofmissingdatarecordsontheoveralldataset.以下两种情况不建议采用此方法:Thismethodisnotrecommendedinthefollowingtwoscenarios:数据集总体存在大量的数据记录不完整情况,且比例较大。Theoveralldatasethasalargenumberofincompletedatarecords,andtheproportionissignificant.带有缺失值的数据记录大量存在着明显的数据分布规则或特征。Alargenumberofdatarecordswithmissingvaluesexhibitobviousdatadistributionpatternsorcharacteristics.残缺值清洗IncompleteValueCleaning丢弃残缺数据DiscardingIncompleteData通过一定的方法将缺失的数据补上,从而形成完整的数据记录,对于后续的数据处理、分析和建模至关重要。Fillinginmissingdatathroughcertainmethodstoformcompletedatarecordsiscriticalforsubsequentdataprocessing,analysis,andmodeling.01020304统计法StatisticalMethod专家补全ExpertCompletion模型法Model-BasedMethod其他方法OtherMethods补全残缺数据CompletingIncompleteData残缺值清洗IncompleteValueCleaning承认缺失值的存在,并且把数据缺失也作为数据分布规律的一部分,这将变量的实际值和缺失都作为输入维度参与后续数据处理和模型计算。Acknowledgetheexistenceofmissingvaluesandtreatdatamissingnessaspartofthedatadistributionpattern,usingbothactualvaluesandmissingnessofvariablesasinputdimensionsforsubsequentdataprocessingandmodelcomputation.例如:转换前:性别,值域:男、女、未知。Forexample:Beforeconversion:Gender,domain:Male,Female,Unknown.转换后:性别_男,值域:1或0;性别_女,值域:1或0;性别_未知,值域:1或0。Afterconversion:Gender_Male,domain:1or0;Gender_Female,domain:1or0;Gender_Unknown,domain:1or0.残缺值清洗IncompleteValueCleaning真值转换法TruthValueConversionMethod很多模型对于缺失值有容忍度或灵活地处理方法,因此在预处理阶段可以不做处理。Manymodelshavetoleranceorflexiblehandlingmethodsformissingvalues,sonoprocessingisneededduringthepreprocessingstage.神经网络NeuralNetworksDBSCANKNN决策树和随机森林DecisionTreesandRandomForest朴素贝叶斯NaiveBayes不做处理NoProcessing残缺值清洗IncompleteValueCleaning1.打开原始数据表格,选中数据区域,在“开始"选项卡下的“编辑"功能组中单击“查找和选择"按钮,点击“定位条件”命令,在弹出的“定位条件”对话框中,选中“空值”,点击“确定"后,所有的空值即可被一次性选中。1.Opentheoriginaldatatable,selectthedatarange,clickthe"Find&Select"buttoninthe"Editing"groupunderthe"Home"tab,clickthe"GoToSpecial"command,inthepop-up"GoToSpecial"dialogbox,select"Blanks",click"OK",andallblankcellswillbeselectedatonce.空值清洗NullValueCleaning空值清洗NullValueCleaning2.定位到空白值后,可以选择“数据补齐”、“删除记录”或者“不处理”。如需数据补齐,则直接输入需要补充的内容,按"Ctrl+Enter"快捷键,进行批量填充。2.Afterlocatingtheblankvalues,youcanchoose"FillData","DeleteRecords",or"NoProcessing".Ifdatafillingisneeded,directlyenterthecontenttobesupplementedandpress"Ctrl+Enter"shortcutkeyforbatchfilling.空值清洗NullValueCleaning02错误数据清洗Errordatacleaning跨境电子商务专业Cross-BorderE-CommerceMajor数据集中某些值明显偏离其他数据,如年龄出现负值或远超正常范围的数值。Somevaluesinthedatasetsignificantlydeviatefromotherdata,suchasnegativeagevaluesorvaluesfarbeyondthenormalrange.数据异常值DataOutliers处理方法:ProcessingMethods:删除法:直接删除异常值。DeletionMethod:Directlydeleteoutliers.修正法:根据业务逻辑或上下文推测的值来修正异常值。CorrectionMethod:Correctoutliersbasedonvaluesinferredfrombusinesslogicorcontext.错误数据清洗ErroneousDataCleaning####单元格中的数据超出了该单元格的宽度,或者单元格中的日期时间公式产生了一个负值Thedatainacellexceedsthecellwidth,orthedate/timeformulainthecellproducesanegativevalue#DIV/O!进行公式运算时,除数使用了数值零、指向了空单元格或包含零值单元格的引用Whenperformingformulacalculations,thedivisoriszero,referstoanemptycell,orreferencesacellcontainingzero错误数据清洗ErroneousDataCleaning分析错误标识符出现的原因,修改B4、B5的数据,然后拖动"C3”单元格的填充柄,将其他发生错误的单元格进行填充修改Analyzethecauseoftheerroridentifiers,modifythedatainB4andB5,thendragthefillhandleofcellC3tofillandcorrectothererroneouscells错误数据清洗ErroneousDataCleaning格式内容清洗FormatandContentCleaning由于系统导出渠道或人为输入习惯的原因,整合而来的原始数据往往不能做到格式统一,内容上也容易出现空格。Duetosystemexportchannelsormanualinputhabits,theintegratedrawdataoftenlacksformatuniformity,andspacesfrequentlyappearinthecontent.错误数据清洗ErroneousDataCleaning
选中“下单时间"整列,右键打开弹出式菜单,点击“设置单元格格式”选项,在弹出的“设置单元格格式”对话框中,选择“数字”选项卡,点击“日期”将其类型修改为如图所示的样式。点击"确定"完成。Selecttheentire"OrderTime"column,right-clicktoopenthecontextmenu,click"FormatCells",inthepop-up"FormatCells"dialogbox,selectthe"Number"tab,click"Date"andmodifyitstypetothestyleshowninthefigure.Click"OK"tocomplete.错误数据清洗ErroneousDataCleaning违反逻辑规律的要求和逻辑规则而产生的错误,一般使用逻辑推理就可以发现问题。Errorsarisingfromviolationsoflogicalprinciplesandrulescangenerallybeidentifiedthroughlogicalreasoning.123数据不合理UnreasonableData如性别为未知,或者消费-40元,明显不符合客观事实Forexample,genderisunknown,orconsumptionis-40yuan,clearlyinconsistentwithobjectivefacts数据自相矛盾Self-ContradictoryData如客户的出生年份是1982年,但年龄却显示22岁Forexample,acustomer’sbirthyearis1982,buttheageshows22yearsold数据不符合规则DataNotMeetingRules如限购1件的商品,客户的购买数量却为5Forexample,aproductwithapurchaselimitof1item,butthecustomer’spurchasequantityis5逻辑错误清洗LogicalErrorCleaning错误数据清洗ErroneousDataCleaning由于该商品限购1件,因此需要将"购买数量"大于1的记录标注出来。选中"购买数量"列,选择“开始"选项卡一"样式”功能组一"条件格式”——"突出显示单元格规格”一”大于”,在弹出的"大于”对话框中,填入数值"1",点击“确定"即可将错误数据标注出来。Sincethisproducthasapurchaselimitof1item,recordswith"PurchaseQuantity"greaterthan1needtobeflagged.Selectthe"PurchaseQuantity"column,choose"Home"tab→"Styles"group→"ConditionalFormatting"→"HighlightCellsRules"→"GreaterThan",inthepop-up"GreaterThan"dialogbox,enterthevalue"1",click"OK"toflagtheerroneousdata.错误数据清洗ErroneousDataCleaning错误数据清洗ErroneousDataCleaning03重复数据清洗Duplicatedatacleaning跨境电子商务专业Cross-BorderE-CommerceMajor识别重复数据的方法多种多样,以下是一些常用的方法和技巧:Therearevariousmethodsforidentifyingduplicatedata.Thefollowingaresomecommonlyusedmethodsandtechniques:0102基于字段匹配识别FieldMatching-BasedIdentification0304基于特定规则识别Rule-BasedIdentification使用数据分析工具UsingDataAnalysisTools人工审查ManualReview重复数据清洗DuplicateDataCleaning以下是几种常见的重复数据清洗方法:Thefollowingareseveralcommonduplicatedatacleaningmethods:重复数据清洗方法DuplicateDataCleaningMethods条件筛选法ConditionalFilteringMethod基于算法的去重方法Algorithm-BasedDeduplicationMethod手动删除法ManualDeletionMethod使用数据清洗工具UsingDataCleaningTools重复数据清洗DuplicateDataCleaning数据被重复、多次记录。重复数据会影响数据处理结果的正确性,从而导致数据分析出现偏差,因此需要将其删除。Dataisrecordedrepeatedlyormultipletimes.Duplicatedataaffectstheaccuracyofdataprocessingresults,leadingtodeviationsindataanalysis,andthereforeneedstobedeleted.重复数据清洗DuplicateDataCleaning重复数据清洗DuplicateDataCleani
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026接待专家面试题库及答案
- 2026年豆包优化服务商全景测评:生态协同视角下的服务商分类图谱与选型指南
- 江西省南昌市进贤一中2025-2026学年七年级上学期期末英语试卷(无答案)
- 河南省周口市项城市新桥镇第二初级中学、南顿镇第二初级中学两校2025-2026学年八年级下学期期末学情调研数学试卷(含答案)
- 人工智能在金融合规中的应用-第38篇
- 2026南昌健康职业技术学院教学督导员招聘笔试备考试题及答案详解
- 2026年贵州省安顺市住房和城乡建设局人员招聘考试备考试题及答案详解
- 2026重庆黔江区中医院编外人员招聘17人考试参考题库及答案详解
- 个性化信贷服务
- 2026年南京市雨花台区住房和城乡建设局人员招聘笔试参考试题及答案详解
- 72番花信风课件
- 绿色矿山知识培训课件
- 供货进度计划一览表
- T/CCMA 0123-2021沥青混凝土摊铺机熨平装置
- 2025年保安证考试理论学习试题及答案
- CQE工作总结与计划
- (高级)电气值班员技能鉴定考试题库(重点高频500题)
- DL∕T 707-2014 HS系列环锤式破碎机
- 2024房建劳务分包的合同范本正规范本
- 心电图读图题附有答案
- 建筑摄影的表现手法(有大量例图)课件
评论
0/150
提交评论