---
title: "Data Mining Concepts and Techniques 3rd 读书笔记(2) "
author: "ratlsun"
date: "2013-05-04T12:05:24Z"
tags: []
categories: ["数据库"]
slug: "data-mining-concepts-and-techniques-3rd-2"
draft: false
lastmod: "2013-05-11T00:57:02Z"
id: 1859643
url: "https://ratlsun.iteye.com/blog/1859643"
---

=============第二章：数据预处理\*\*\*\*\*\*\*\*\*第二节：描述性统计概述=================

1. Measuring the Central Tendency
   
   - 算数平均 arithmetic mean / 加权平均 weighted arithmetic mean：对过大过小值敏感，属于algebraic measure
   - 裁剪后平均 trimmed mean：去掉一定比例的过值后进行平均，属于algebraic measure
   - 中位数 median：适用于非对称分布数据，属于holistic measure，可以通过分组近似估算中间组的中位数。
   - 众数 mode：可以根据含有众数的多少把数据分为 - 无峰值数据no mode，单峰值数据unimodal和多峰值数据multimodal，分布曲线平稳的单峰值数据的众数可以通过经验公式mean-mode = 3\*(mean-median)来计算，属于algebraic measure
   - unimodal数据为均匀分布时mean=median=mode，为正倾斜分布（较小值出现的频率高）时mean&gt;median&gt;mode，为负倾斜分布（较大值出现的频率高）时mean&lt;median&lt;mode
   - 中列数 midrange：最大最小值求平均，属于algebraic measure
2. Measuring the Dispersion of Data
   
   - 范围 range：最大值减最小值
   - 百分位数 kth percentile：median相当于 50th percentile，常用的还有Q1 - first quartiles 和 Q3 - third quartiles
   - 内距 IQR - interquartile range：Q3-Q1，属于holistic measure，通常1.5倍IQR以外的值可以被认为是outliers
   - 五数概括法 five-number summary：Minimum; Q1; Median; Q3; Maximum
   - 箱线图 Boxplots：大数据情况下暂时没有好的近似算法
   - 方差 Variance / 标准差 Standard Deviation：当把mean作为数据的中心时，标准差可用来计算数据的离散程度，属于algebraic measure
3. Graphic Displays of Basic Descriptive Data Summaries
   
   - 直方图 frequency histograms：适用于单变量
   - 分位图 quantile plot：按0.5/n为偏移量，1/n为步长画出n个点的值
   - QQ图 quantile-quantile plot：2个quantile plot进行对比，点数取少的那个，某一个系列quantile值映射到x坐标
   - 散点图 scatter plot; 用来看2个属性之间的关联性
   - 局部回归光滑拟合曲线 loess curve：a（阿发）参数为平滑系数，越大越平滑，但数据失真大，一般取0.25到1之间的值；l（仁达）参数为曲线多项式的次数，通常为1（线性）或者2（2次曲线）

======对数据进行描述性统计可以提供整个数据的概览，方便鉴别数据噪声和过值，为数据清洗做准备========

=============第二章：数据预处理\*\*\*\*\*\*\*\*\*第三节：数据清洗=================

1. Missing Values
   
   - 直接忽略 Ignore the tuple：通常用在分类算法时记录的某个类别的属性缺失，当缺失数据占比较大时肯定是不可取的做法
   - 手工补录数据 Fill in the missing value manually：oom
   - 全部用一个常量代替 Use a global constant to fill in the missing value：常用的常量是UNKNOWN，不是办法的办法。
   - 用在整体样本上该缺失属性的均值代替 Use the attribute mean to fill in the missing value：
   - 用在同类别样本上该缺失属性的均值代替 Use the attribute mean for all samples belonging to the same class as the given tuple：前提是已经有一个已经明确分好的类别，并且假设这个缺失属性和该类别强相关
   - 用样本空间里的记录的其他属性推断出该缺失属性的值 Use the most probable value to fill in the missing value：最常用或者相对比较合理的清洗方式，采用的推断方式一般是回归分析，决策树和贝叶斯推断

====== ========