You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ec4c73b
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -17,7 +17,9 @@ In-class assessment 20% + One assignment 40% + A final examination 40%
17
17
- W12-16 Data Streams, Social Networks, Web Data
18
18
- Group Assignment due 6 June 2026
19
19
20
-
# 1 Intro
20
+
# W1-4
21
+
22
+
## 1 Intro
21
23
22
24
> Data mining is a process of extracting previously unknown,
23
25
valid, and actionable information from large databases and
@@ -35,10 +37,25 @@ Given an n×d training data matrix D (database D), and a class label value in {1
35
37
36
38
**1. Classification and regression methods are usually described as supervised learning methods. Explain why. And describe the difference between the two.**
37
39
40
+
> Because they learn from labeled training data. The model learns the relationship between inputs and outputs.
41
+
> The diff is that classification **predicts discrete class labels**, while regression **predicts continuos numeric values**.
42
+
43
+
分类是离散类别,回归是连续数值。
44
+
38
45
**2. What do you need in order to produce a classification model?**
46
+
47
+
> A labeled training dataset, input features (attributes), class lables, a classification algorithm, a training process to learn the model.
48
+
39
49
**3. How do you know that you have produced a good model?**
50
+
51
+
> It gains great score when using test data.
52
+
53
+
如 Accuracy,Precision,Recall,F1-score.
54
+
40
55
**4. Why is a classification model also called a generalized model?**
41
56
57
+
> Because it learns general patterns from training data and applies them to unseen data.
58
+
> The goal is not to memorize the training data but to generalize to new instances.
42
59
43
60
### Def 2 Data Clustering (数据聚类)
44
61
@@ -49,9 +66,20 @@ Given a data matrix D, partition its rows (records) into sets/clusters C1 . . .
49
66
### Dis 2
50
67
51
68
**1. Explain how a clustering task differs from a classification task.**
69
+
70
+
> Classification is a supervised learning task while clustering task is an unsupervised learning task.
71
+
52
72
**2. What is the core operation/measurement required in a clustering task?**
73
+
74
+
> Similarity or distance calculation between data points.
75
+
76
+
聚类的核心只有一个问题:两个数据点有多相似?
77
+
因此聚类算法最重要的是距离或相似度计算。
78
+
53
79
**3. How do you know that you have produced a good clustering outcome?**
54
80
81
+
> High similarity with clusters and low similarity between clusters.
82
+
55
83
### Def 3 Outlier Detection (异常检测)
56
84
57
85
Given a data matrix D, determine the few rows of the data matrix that are very different from the majority of rows in the matrix.
@@ -61,9 +89,20 @@ Given a data matrix D, determine the few rows of the data matrix that are very d
61
89
### Dis 3
62
90
63
91
**1. Explain how an anomaly detection task differs from a classification task.**
92
+
93
+
> Anomaly detection aims to identify rare or unusual instances that significantly deviate from the majority of the data. It is often unsupervised or semi-supervised because anomalies are usually unknown beforehand.
94
+
> Classification is a supervised learning task.
95
+
64
96
**2. Explain how it differs from a clustering task.**
97
+
98
+
> Clustering groups data points into clusters based on similarity, while anomaly detection focuses on identifying points.
99
+
100
+
它们都是无监督学习。聚类找到数据中的多个群体结构,异常检测关注偏离群体的点。
101
+
65
102
**3. How do you know that you have produced a good anomaly detection outcome?**
66
103
104
+
> A good anomaly detection result correctly identifies rare abnormal instances while minimizing false positives. Evaluation may use labeled anomalies, precision/recall, or domain knowledge.
105
+
67
106
### Def 4 Frequent Pattern Mining (频繁模式挖掘)
68
107
69
108
**Definition 4 (Frequent Pattern Mining)** Given a binary n×d data matrix D, determine all subsets of columns such that all the values in these columns take on the value of 1 for at least a fraction s of the rows in the matrix. The relative frequency of a pattern is referred to as its support. The fraction s is referred to as the minimum support.
@@ -79,9 +118,17 @@ Given a data matrix D, determine the few rows of the data matrix that are very d
79
118
### Dis 4
80
119
81
120
**1. How does association pattern mining differ from other data mining tasks?**
121
+
122
+
> Association pattern mining is an unsupervised task that discovers relationships (co-occurrence patterns) among items in data.
123
+
82
124
**2. How does association pattern mining differ from rule-based classification?**
125
+
126
+
> Association pattern mining discovers rules based on co-occurrence without a target variable, while rule-based classification learns rules specifically to predict a predefined class label.
127
+
83
128
**3. What is a search space?**
84
129
130
+
> The set of all possible candidate solutions.
131
+
85
132
### Ass i.i.d
86
133
87
134
Every data point in a dataset is independent and identically distributed
@@ -106,10 +153,18 @@ Is there any issue in using a classification model trained from P to classify a
106
153
- Transductive (a special semi-supervised) learning
107
154
108
155
### Ques
109
-
1. Does a semi-supervised learning refer to supervised or unsupervised learning or something completely different?4
110
-
2. How does semi-supervised learning impact on model evaluation?
111
156
112
-
# 2 Data
157
+
**1. Does a semi-supervised learning refer to supervised or unsupervised learning or something completely different?**
158
+
159
+
> Hybrid. It uses a small amount of labeled data (supervised) together with a large amount of unlabeled data (unsupervised) to improve learning.
160
+
161
+
**2. How does semi-supervised learning impact on model evaluation?**
162
+
163
+
> Evaluation in semi-supervised learning must focus on labeled data, since only labeled points provide ground truth. The presence of unlabeled data affects training but does not directly provide evaluation metrics, which makes careful validation crucial.
@@ -120,14 +175,170 @@ Is there any issue in using a classification model trained from P to classify a
120
175
121
176
### Dis 5
122
177
123
-
1. What is the attribute type of each of the following kinds of attributes (a)Age,(b) Salary, (c) Zip Code, (d) Province of Residence, (e) Height, (f) Weight.
124
-
2. An analyst sets up a sensor network in order to measure the temperature of different locations over a period. What is the data type of the data collected?
125
-
3. An analyst processes Web logs in order to create records with the ordering information for Web page accesses from different users. What is the type of this data?
126
-
4. Describe the difference between interval and ratio attribute type.
127
-
5. Suppose that you are employed as a data mining consultant for an Internet search engine company. Describe how data mining can help the company by giving specific examples of how techniques, such as clustering, classification, association rule mining, and anomaly detection can be applied.
128
-
6. Distinguish between noise and outliers. Consider the following questions.
178
+
**1. What is the attribute type of each of the following kinds of attributes (a)Age,(b) Salary, (c) Zip Code, (d) Province of Residence, (e) Height, (f) Weight.**
**2. An analyst sets up a sensor network in order to measure the temperature of different locations over a period. What is the data type of the data collected?**
190
+
191
+
> Interval + Ratio.
192
+
193
+
**3. An analyst processes Web logs in order to create records with the ordering information for Web page accesses from different users. What is the type of this data?**
194
+
195
+
> Complex data object. Nominal
196
+
197
+
**4. Describe the difference between interval and ratio attribute type.**
**5. Suppose that you are employed as a data mining consultant for an Internet search engine company. Describe how data mining can help the company by giving specific examples of how techniques, such as clustering, classification, association rule mining, and anomaly detection can be applied.**
206
+
207
+
> Clustering: Group users by search behavior to personalize recommendations.
208
+
> Classification: Predict whether a search query will lead to a click or conversion.
209
+
> Association rule mining: Find frequent co-occurrences of search queries (e.g., “laptop → laptop bag”).
**6. Distinguish between noise and outliers. Consider the following questions.
129
213
(a) Is noise ever interesting or desirable? Outliers?
130
214
(b) Can noise objects be outliers?
131
215
(c) Are noise objects always outliers?
132
216
(d) Are outliers always noise objects?
133
-
(e) Can noise make a typical value into an unusual one, or vice versa?
217
+
(e) Can noise make a typical value into an unusual one, or vice versa?**
218
+
219
+
> (a) noise: not intersting. Outliers: often
220
+
> (b) yes
221
+
> (c) No, noise may just add small variations without being extreme
222
+
> (d) No, outliers may be valid, rare patterns
223
+
> (e) Yes, noise can distort data to appear as unusual (false outlier) or mask a real outlier
224
+
225
+
## 3 Distances
226
+
227
+
### Def 6 K-Means Clustering(K-均值聚类)
228
+
229
+
Given a data matrix $D$ with $n$ rows (records) and $d$ columns (features), partition the rows into $k$ clusters $C\_1, …, C\_k$ such that the sum of squared distances between each point and the centroid of its assigned cluster is minimized. Specifically:
230
+
1. For each cluster $C\_j$ , compute the centroid:

264
+
265
+
> K-means assumes convex, spherical clusters and minimizes distance to centroids.
266
+
> So:
267
+
> - For ring-shaped data, it cuts across rings because rings are non-convex → wrong grouping.
268
+
> - For two moons / curved shapes, it splits by straight boundaries → fails to capture the true structure.
269
+
270
+
核心原因:k-means 的“模型假设”不适合这些数据形状。
271
+
k-means 的本质是:
272
+
- 用质心(centroid)表示每个簇
273
+
- 最小化每个点到其质心的 欧氏距离平方
274
+
- 等价于假设:每个簇是“凸的、近似球形的”
275
+
276
+
> DBSCAN groups points by density connectivity instead of distance to centroids.
277
+
> So:
278
+
> - It can detect arbitrary-shaped clusters (rings, curves)
279
+
> - Points connected through dense regions form one cluster → correct grouping
280
+
281
+
核心原因:DBSCAN 是“基于密度”的,而不是基于中心点。
282
+
DBSCAN 的关键思想:
283
+
定义一个半径 $ε$(邻域)
284
+
如果某点附近有足够多点($minPts$),它就是“核心点”
285
+
相互“密度可达”的点会被连成一个簇
286
+
287
+
288
+
### Def 9 Isolation Kernel (隔离核)
289
+
290
+
Isolation Kernel of any two points $x, y \in \mathbb{R}^d$ is defined to be the expectation taken over the probability distribution $P\_{H\_\psi(D)}$ on all partitionings $H \in H\_\psi(D)$ such that both $x$ and $y$ fall into the same isolating partition $\theta[z] \in H$:
291
+
$$
292
+
K_\psi(x, y \mid D)
293
+
= \mathbb{E}_{H \sim P_{H_\psi(D)}}
294
+
\left[
295
+
\mathbf{1}\big( x, y \in \theta[z] \mid \theta[z] \in H \big)
296
+
\right],
297
+
$$
298
+
where $\mathbf{1}(\cdot)$ is an indicator function.
299
+
300
+
> 如果两个点经常被分在同一个区域 → 它们相似
301
+
> 如果很容易被分开 → 它们不相似
302
+
> 隔离核描述了两个点有多相似。
303
+
304
+
Definition 9.1 Isolation Kernel $K\_\psi$ has a feature map $\Phi : x \mapsto \{0,1\}^{t \times \psi}$.
305
+
$K_\psi$ has no closed-form expression and is expressed in terms of $\Phi$ as follows:
0 commit comments