DM NOTES
DM NOTES
DATA MINING
SYLLABUS:
Unit– I
Unit-II
Association Rules: Problem Definition, Frequent Itemsets Generation Association Rule Mining,
The Apriori Principle, Support and Confidence Measures, Association Generation: Apriori
Algorithm, The Partition Algorithms, FP-Growth Algorithms, Compact Representation of
Frequent Item Set-Maximal Frequent Item Set, Closed Frequent Item Set,
Unit – III
Unit – IV
Unit – IV
Web And Text Mining: Introduction, Web Mining, Web Content Mining, Web Structure Mining,
We Usage Mining, Text Mining- Unstructured Text, Episode Rule Discovery For Texts,
Hierarchy Of Categories, Text Clustering
Chapter-1
Data mining refers to extracting or mining knowledge from large amounts of data. The term is a
misnomer. Thus, data mining should have been more appropriately named as knowledge mining
which emphasizes mining from large amounts of data.
It is the computational process of discovering patterns in large data sets involving methods at the
intersection of artificial intelligence, machine learning, statistics, and database systems.
The overall goal of the data mining process is to extract information from a data set and
transform it into an understandable structure for further use.
Data mining derives its name from the similarities between searching for valuable business
information in a large database — for example, finding linked products in gigabytes of store
scanner data — and mining a mountain for a vein of valuable ore. Both processes require either
sifting through an immense amount of material or intelligently probing it to find exactly where
the value resides. Given databases of sufficient size and quality, data mining technology can
generate new business opportunities by providing these capabilities:
Automated prediction of trends and behaviors. Data mining automates the process of finding
predictive information in large databases. Questions that traditionally required extensive hands-
on analysis can now be answered directly from the data — quickly. A typical example of a
predictive problem is targeted marketing. Data mining uses data on past promotional mailings to
identify the targets most likely to maximize return on investment in future mailings. Other
predictive problems include forecasting bankruptcy and other forms of default and identifying
segments of a population likely to respond similarly to given events.
Automated discovery of previously unknown patterns. Data mining tools sweep through
databases and identify previously hidden patterns in one step. An example of pattern discovery is
the analysis of retail sales data to identify seemingly unrelated products that are often purchased
together. Other pattern discovery problems include detecting fraudulent credit card transactions
and identifying anomalous data that could represent data entry keying errors.
Clustering – is the task of discovering groups and structures in the data that are in some
way or another "similar", without using known structures in the data.
Classification – is the task of generalizing known structure to apply to new data. For
example, an e-mail program might attempt to classify an e-mail as "legitimate" or as
"spam".
Regression – attempts to find a function that models the data with the least error.
Summarization – providing a more compact representation of the data set,
including visualization and report generation.
A typical data mining system may have the following major components.
1. Knowledge Base:
This is the domain knowledge that is used to guide the search or evaluate the
interestingness of resulting patterns. Such knowledge can include concept
hierarchies,
used to organize attributes or attribute values into different levels of abstraction.
Knowledge such as user beliefs, which can be used to assess a pattern’s
interestingness based on its unexpectedness, may also be included. Other examples of
domain knowledge are additional interestingness constraints or thresholds, and
metadata (e.g., describing data from multiple heterogeneous sources).
This is essential to the data mining system and ideally consists of functional modules
for tasks such as characterization, association and correlation analysis, classification,
prediction, cluster analysis, outlier analysis, and evolution analysis.
This component typically employs interestingness measures to interact with the data
mining modules to focus the search toward interesting patterns. It may use
interestingness thresholds to filter out discovered patterns. Alternatively, the pattern
evaluation module may be integrated with the mining module, depending on the
implementation of the data mining method used. For efficient data mining, it is highly
recommended to push the evaluation of pattern interestingness as deep as possible
into the mining process to confine the search to only the interesting patterns.
4. User interface:
This module communicates between users and the data mining system, allowing the
user to interact with the system by specifying a data mining query or task, providing
information to help focus the search, and performing exploratory data mining based
on the intermediate data mining results. In addition, this component allows the user to
browse database and data warehouse schemas or data structures, evaluate mined
patterns, and visualize the patterns in different forms.
1.5 Data Mining Process:
Data Mining is a process of discovering various models, summaries, and derived values from a
given collection of data.
The general experimental procedure adapted to data-mining problems involves the following
steps:
1. State the problem and formulate the hypothesis
This step is concerned with how the data are generated and collected. In general, there are
two distinct possibilities. The first is when the data-generation process is under the
control of an expert (modeler): this approach is known as a designed experiment. The
second possibility is when the expert cannot influence the data-generation process: this is
known as the observational approach. An observational setting, namely, random data
generation, is assumed in most data-mining applications. Typically, the sampling
distribution is completely unknown after data are collected, or it is partially and implicitly
given in the data-collection procedure. It is very important, however, to understand how
data collection affects its theoretical distribution since such a priori knowledge can be
very useful for modeling and, later, for the final interpretation of results. Also, it is
important to make sure that the data used for estimating a model and the data used later
for testing and applying a model come from the same, unknown, sampling distribution. If
this is not the case, the estimated model cannot be successfully used in a final application
of the results.
In the observational setting, data are usually "collected" from existing databases, data
warehouses, and data marts. Data preprocessing usually includes at least two common
tasks:
1. Outlier detection (and removal) – Outliers are unusual data values that are not
consistent with most observations. Commonly, outliers result from measurement
errors, coding and recording errors, and, sometimes, are natural, abnormal values.
Such nonrepresentative samples can seriously affect the model produced later. There
are two strategies for dealing with outliers:
2. Scaling, encoding, and selecting features – Data preprocessing includes several steps
such as variable scaling and different types of encoding. For example, one feature with
the range [0, 1] and the other with the range [−100, 1000] will not have the same weights
in the applied technique; they will also influence the final data-mining results differently.
Therefore, it is recommended to scale them and bring both features to the same weight
for further analysis. Also, application-specific encoding methods usually achieve
dimensionality reduction by providing a smaller number of informative features for
subsequent data modeling.
These two classes of preprocessing tasks are only illustrative examples of a large
spectrum of preprocessing activities in a data-mining process.
Data-preprocessing steps should not be considered completely independent from other
data-mining phases. In every iteration of the data-mining process, all activities, together,
could define new and improved data sets for subsequent iterations. Generally, a good
preprocessing method provides an optimal representation for a data-mining technique by
incorporating a priori knowledge in the form of application-specific scaling and
encoding.
The selection and implementation of the appropriate data-mining technique is the main
task in this phase. This process is not straightforward; usually, in practice, the
implementation is based on several models, and selecting the best one is an additional
task. The basic principles of learning and discovery from data are given in Chapter 4 of
this book. Later, Chapter 5 through 13 explain and analyze specific techniques that are
applied to perform a successful learning process from data and to develop an appropriate
model.
In most cases, data-mining models should help in decision-making. Hence, such models
must be interpretable to be useful because humans are not likely to base their decisions
on complex "black-box" models. Note that the goals of the model's accuracy and its
interpretation's accuracy are somewhat contradictory. Usually, simple models are more
interpretable, but they are also less accurate. Modern data mining methods are expected
to yield highly accurate results using high-dimensional models. The problem of
interpreting these models, also very important, is considered a separate task, with specific
techniques to validate the results. A user does not want hundreds of pages of numeric
results. He does not understand them; he cannot summarize, interpret, and use them for
successful decision-making.
The data mining system can be classified according to the following criteria:
Database
Technology Statistics
Machine Learning
Information Science
Visualization
Other Disciplines
Some Other Classification Criteria:
We can classify the data mining system according to the kind of databases mined. Database
systems can be classified according to different criteria such as data models, types of data, etc.
And the data mining system can be classified accordingly. For example, if we classify the
database according to the data model then we may have a relational, transactional, object-
relational, or data warehouse mining system.
We can classify the data mining system according to the kind of knowledge mined. It means
data mining systems are classified based on functionalities such as:
Characterization
Discrimination
Association and Correlation Analysis
Classification
Prediction
Clustering
Outlier Analysis
Evolution Analysis
Classification according to the kinds of techniques utilized
We can classify the data mining system according to the kind of techniques used. We can
describe these techniques according to the degree of user interaction involved or the methods
of analysis employed.
We can classify the data mining system according to the application adapted. These applications
are as follows:
Finance
Telecommunications
DNA
Stock Markets
E-mail
Mining different kinds of knowledge in databases. - The needs of different users are not the
same. Different users may be interested in different kinds of knowledge. Therefore, it is
necessary for data mining to cover a broad range of knowledge discovery tasks.
Interactive mining of knowledge at multiple levels of abstraction. - The data mining process
needs to be interactive because it allows users to focus the search for patterns, providing and
refining data mining requests based on returned results.
Incorporation of background knowledge. - To guide the discovery process and to express the
discovered patterns, the background knowledge can be used. Background knowledge may be
used to express the discovered patterns not only in concise terms but at multiple levels of
abstraction.
Data mining query languages and ad hoc data mining. - Data Mining Query language that
allows the user to describe ad hoc mining tasks, should be integrated with a data warehouse
query language and optimized for efficient and flexible data mining.
Presentation and visualization of data mining results. - Once the patterns are discovered
they need to be expressed in high-level languages, and visual representations. This representation
should be easily understandable by the users.
Handling noisy or incomplete data. - The data cleaning methods are required that can handle
the noise, and incomplete objects while mining the data regularities. If data cleaning methods are
not there then the accuracy of the discovered patterns will be poor.
Pattern evaluation. - It refers to the interestingness of the problem. The patterns discovered
should be interesting because either they represent common knowledge or lack novelty.
Efficiency and scalability of data mining algorithms. - To effectively extract the information
from huge amounts of data in databases, data mining algorithms must be efficient and scalable.
Parallel, distributed, and incremental mining algorithms. - Factors such as the huge size of
databases, wide distribution of data, and complexity of data mining methods motivate the
development of parallel and distributed data mining algorithms. These algorithms divide the
data into partitions which are further processed in parallel. Then the results from the partitions
are merged. The incremental algorithms update databases without having to mine the data
again from scratch.
Knowledge Discovery in Databases (KDD)
Some people treat data mining the same as Knowledge discovery while some people view
data mining essential step in the process of knowledge discovery. Here is the list of steps
involved in the knowledge discovery process:
Data Cleaning - In this step the noise and inconsistent data are removed.
Data Integration - In this step, multiple data sources are combined.
Data Selection - In this step relevant to the analysis task are retrieved from the database.
Data Transformation - In this step data are transformed or consolidated into
forms appropriate for mining by performing summary or aggregation operations.
Data Mining - In this step, intelligent methods are applied to extract data patterns.
Pattern Evaluation - In this step, data patterns are evaluated.
Knowledge Presentation - In this step, knowledge is represented.
The following diagram shows the process of knowledge discovery process:
Architecture of KDD
The algorithms used for summarization, include measure and dimension definition
algorithms, data on granularity, partitions, subject areas, aggregation, summarization, and
predefined queries and reports.
The mapping from the operational environment to the data warehouse includes source
databases and their contents, gateway descriptions, data partitions, data extraction,
cleaning, transformation rules, and defaults, data refresh and purging rules, and security
(user authorization and access control).
Data related to system performance, which include indices and profiles that improved
access and retrieval performance, in addition to rules for the timing and scheduling of
refresh, update, and replication cycles.
Data Integration:
It combines data from multiple sources into a coherent data store, as in data warehousing. These
sources may include multiple databases, data cubes, or flat files.
How can the data analyst or the computer be sure that the customer id in one database
and the customer number in another reference to the same attribute?
2. Redundancy:
An attribute (such as annual revenue, for instance) may be redundant if it can be derived
from another attribute or set of attributes. Inconsistencies in attribute or dimension
naming can also cause redundancies in the resulting data set.
For the same real-world entity, attribute values from different sources may differ.
Data Reduction:
Data reduction techniques can be applied to obtain a reduced representation of the data set that is
much smaller in volume, yet closely maintains the integrity of the original data. That is, mining
on the reduced data set should be more efficient yet produce the same (or almost the same)
analytical results.
Strategies for data reduction include the following:
Data cube aggregation, where aggregation operations are applied to the data in the
construction of a data cube.
Dimensionality reduction, where encoding mechanisms are used to reduce the dataset
size.
Numerosity reduction, where the data are replaced or estimated by alternative, smaller
data representations such as parametric models (which need to store only the model
parameters instead of the actual data) or nonparametric methods such as clustering,
sampling, and the use of histograms.
Discretization and concept hierarchy generation, where raw data values for attributes are
replaced by ranges or higher conceptual levels. Data discretization is a form of numerosity
reduction that is very useful for the automatic generation of concept hierarchies.
Discretization and concept hierarchy generation are powerful tools for data mining, in that
they allow the mining of data at multiple levels of abstraction.
Dimensionality Reduction:
Dimensionality reduction is a data preprocessing technique used in data mining to reduce the number
of input variables (features or dimensions) in a dataset while preserving as much relevant information
as possible. It is particularly useful when dealing with high-dimensional datasets, where many
features may be redundant, irrelevant, or noisy.
Why Dimensionality Reduction is Important
1. Improves Model Performance:
o Reduces overfitting by eliminating irrelevant features.
o Enhances algorithm performance by decreasing computation time.
2. Simplifies Data Visualization:
o Helps in visualizing high-dimensional data by projecting it onto 2D or 3D spaces.
3. Reduces Storage Requirements:
o Lessens memory and storage demands by removing redundant data.
4. Eases Interpretability:
o Simplifies complex datasets, making the insights more understandable.
Techniques for Dimensionality Reduction
1. Feature Selection
Selects a subset of relevant features while discarding irrelevant ones.
Common methods:
o Filter Methods: Use statistical techniques (e.g., correlation, chi-square) to rank
features.
o Wrapper Methods: Use model-based evaluation (e.g., forward or backward
selection).
o Embedded Methods: Combine feature selection with model training (e.g., Lasso
regression).
2. Feature Extraction
Creates new features by combining or transforming existing ones.
Common techniques:
o Principal Component Analysis (PCA):
Projects data onto a lower-dimensional space by finding directions (principal
components) that maximize variance.
Retains most of the dataset’s variability.
o Linear Discriminant Analysis (LDA):
Maximizes separability among classes by finding linear combinations of
features.
o t-SNE (t-Distributed Stochastic Neighbor Embedding):
Non-linear dimensionality reduction method focused on preserving local
relationships in data.
o Autoencoders:
Neural network-based technique for non-linear feature extraction, often used
in deep learning.
o Independent Component Analysis (ICA):
Focuses on maximizing statistical independence among extracted components.
3. Clustering-Based Reduction
Groups similar features or data points and replaces them with representative features.
Techniques: K-Means, Hierarchical Clustering.
4. Manifold Learning
Maps high-dimensional data to lower dimensions while preserving its structure.
Techniques: Isomap, Locally Linear Embedding (LLE).
Applications
1. Data Visualization:
o Simplify complex datasets for 2D/3D visual exploration.
o Example: Visualizing customer segments in marketing.
2. Preprocessing for Machine Learning:
o Reduce computation time and enhance model accuracy.
o Example: Simplifying datasets for training machine learning models.
3. Noise Reduction:
o Eliminate noisy or irrelevant data for better analysis.
o Example: Removing redundant features in sensor data.
4. Genomics:
o Analyze large-scale gene expression data with fewer variables.
o Example: Identifying significant genes related to diseases.
Advantages of Dimensionality Reduction
1. Reduces Computational Costs:
o Less memory and processing power required.
2. Improves Model Generalization:
o Reduces overfitting by eliminating irrelevant dimensions.
3. Simplifies Data Analysis:
o Helps focus on the most important features.
Limitations
1. Loss of Information:
o Reduction might discard critical data, impacting accuracy.
2. Interpretability:
o Transformed features (e.g., PCA components) may lack interpretability.
3. Computational Complexity:
o Some methods (e.g., t-SNE) can be computationally expensive.
4. Parameter Sensitivity:
o Results can vary significantly based on chosen parameters (e.g., number of
components in PCA).
Dimensionality reduction is an essential technique in data mining, enabling effective analysis and
model building, especially with high-dimensional datasets. Choosing the right method depends on
the dataset characteristics and the goals of the analysis.
Discretization and Binarization:
Discretization and binarization are preprocessing techniques in data mining that transform
continuous or categorical data into forms that are easier to analyse, especially for certain algorithms
like decision trees, rule-based systems, or clustering.
1. Discretization
Definition:
Discretization converts continuous data (e.g., numerical values like age, and temperature) into
discrete intervals or categories (e.g., "young," "middle-aged," "old").
Types of Discretization
1. Unsupervised Discretization:
o Does not use class labels and divides the data based purely on numerical distribution.
o Techniques:
Equal Width Binning:
Divides the range of values into intervals of equal size.
Example:
Age: [18–30), [30–50), [50–70).
Equal Frequency Binning:
Divides the range such that each bin contains approximately the same
number of data points.
Example:
For 100 records: [18–25), [25–35), [35–50).
2. Supervised Discretization:
o Considers class labels when creating bins to maximize information gain or minimize
entropy.
o Techniques:
Entropy-Based Discretization:
Uses class information to determine the optimal intervals.
Example: Dividing a continuous variable where intervals maximize the
separation of class labels.
ChiMerge:
Merges adjacent intervals based on the chi-squared test to group values
with similar distributions.
Advantages of Discretization
Reduces Complexity:
o Simplifies data representation by converting continuous variables into a smaller set of
discrete categories.
Improves Interpretability:
o Categories (e.g., "low," "medium," "high") are easier to interpret than raw numerical
values.
Compatibility with Algorithms:
o Some algorithms work better with discrete data (e.g., Naive Bayes, decision trees).
Limitations of Discretization
Loss of Information:
o Aggregating data into intervals can discard fine-grained details.
Parameter Sensitivity:
o Results depend on the choice of intervals or binning methods.
Boundary Issues:
o Data near bin edges may be misclassified or lose meaningful comparisons.
o
2. Binarization
Definition:
Binarization converts categorical or numerical data into binary (0 or 1) values, representing the
presence or absence of a feature.
Types of Binarization:
1. For Numerical Data:
o Threshold-Based Binarization:
A threshold value is chosen, and values above the threshold are set to 1, while
values below are set to 0.
Example:
Income > $50,000 → 1 (High); Income ≤ $50,000 → 0 (Low).
2. For Categorical Data:
o One-Hot Encoding:
Converts a categorical variable with kk categories into kk binary variables.
Example:
Colour: {Red, Green, Blue} → (1, 0, 0), (0, 1, 0), (0, 0, 1).
o Binary Encoding:
Assigns each category a unique binary code.
Example:
Categories: {A, B, C, D} → {00, 01, 10, 11}.
Advantages of Binarization
Simplifies Data Representation:
o Binary values are straightforward and work well with many machine-learning
algorithms.
Compatibility with Algorithms:
o Algorithms like SVMs and neural networks often prefer binary inputs.
Removes Ordinality Issues:
o One-hot encoding prevents algorithms from assuming an ordinal relationship among
categories.
Limitations of Binarization
Increased Dimensionality:
o One-hot encoding for categorical variables with many unique values (e.g., city names)
can lead to very high-dimensional data.
Loss of Information:
o Binary representations may oversimplify relationships (e.g., threshold-based
binarization discards magnitude information).
Memory and Computation Cost:
o More binary features increase the computational load.
Applications in Data Mining
1. Discretization:
o Often used in algorithms requiring discrete inputs, like Naive Bayes or rule-based
classifiers.
o Useful for visualizing patterns in numerical data.
2. Binarization:
o Essential for methods that rely on binary input, such as association rule mining and
some clustering algorithms.
o Common in text mining (e.g., presence/absence of keywords).
Comparison
Aspect Discretization Binarization
Input Data Continuous Continuous or Categorical
Output Data Discrete categories Binary (0 or 1)
Reducing complexity of continuous
Use Case Representing data in binary form for models
variables
Impact on Often increases dimensionality (e.g., one-hot
May reduce dimensionality
Features encoding)
Discretization and binarization are critical for preparing data for specific algorithms, enabling better
performance and interpretability. However, their use depends on the dataset characteristics and the
goals of the analysis.
Data Transformation:
In data transformation, the data are transformed or consolidated into forms appropriate for mining.
Smoothing, which works to remove noise from the data. Such techniques include
binding, regression, and clustering.
Aggregation, where summary or aggregation operations are applied to the data. For
example, the daily sales data may be aggregated to compute monthly and annual total
amounts. This step is typically used in constructing a data cube to analyze the data at
multiple granularities.
Generalization of the data, where low-level or ―primitive‖ (raw) data are replaced by
higher-level concepts through concept hierarchies. For example, categorical attributes,
like streets, can be generalized to higher-level concepts, like city or country.
Normalization, where the attribute data are scaled to fall within a small specified range,
such as 1:0 to 1:0, or 0:0 to 1:0.
Attribute construction (or feature construction), where new attributes are constructed
and added from the given set of attributes to help the mining process.
Data Transformation:
Data transformation in data mining refers to converting data into an appropriate format or structure
to make it more suitable for analysis or to enhance the performance of mining algorithms. It plays a
critical role in preparing raw data for mining tasks such as classification, clustering, and association
rule mining.
Similarity Measures:
Similarity measures are fundamental tools in data technological know-how, enabling us to quantify
how alike two information factors are. These measures are pivotal in various applications together
with clustering, category, and information retrieval. In this newsletter, we will discover a number of
the most typically used similarity measures, their formulas, descriptions, and usual packages.
1. Euclidean Distance
Formula:
Description: Euclidean distance is the direct distance among points in a multi-dimensional space. It is
intuitive and extensively used in lots of applications, especially whilst the functions are non-stop and
the size is steady across dimensions.
Applications: It is commonly used in clustering algorithms together with the okay-method and in
nearest-neighbor searches.
2. Cosine Similarity
Formula:
Description: Cosine similarity measures the cosine of the perspective between vectors. It is
specifically useful in excessive-dimensional areas, which include textual content mining, in which it
measures the orientation in place of significance, making it scale-invariant.
Applications: Widely utilized in text mining and information retrieval, which include record
similarity in serps.
3. Jaccard Similarity
Formula:
Description: Jaccard similarity measures the similarity among two finite sets with the aid of dividing
the dimensions of their intersection via the dimensions of their union. It is beneficial for comparing
specific records.
Applications: Commonly used in clustering and classification tasks regarding categorical statistics,
consisting of market basket evaluation.
4. Pearson Correlation Coefficient
Description: Pearson correlation measures the linear correlation among two variables, supplying a
value between -1 and 1. It assesses how nicely a change in a single variable predicts a trade in some
other.
Applications: Used in statistical evaluation and system studying to discover and quantify linear
relationships between features.
5. Hamming Distance
Formula:
Description: Hamming distance measures the number of positions at which the corresponding factors
of strings are one-of-a-kind. It is especially useful for binary or specific information.
Applications: Used in mistake detection and correction algorithms, in addition to comparing binary
sequences or express variables.
Applications of Similarity Measures:
Similarity measures are pivotal in numerous information technological know-how packages,
enabling algorithms to institution, classify, and retrieve records based totally on how alike the facts
points are. This functionality is essential in fields starting from textual content mining to image
popularity. Here, we discover some key packages of similarity measures.
1. Clustering
Clustering entails grouping a set of gadgets such that items in the identical institution (or cluster) are
greater just like every aside from to the ones in different agencies. Similarity measures play an
essential function in defining these groups.
o K-Means Clustering: Uses Euclidean distance to partition information into ok clusters. Each
facts factor is assigned to the cluster with the nearest centroid.
o Hierarchical Clustering: Uses diverse distance metrics (e.G., Euclidean, Manhattan) to
construct a hierarchy of clusters, often visualized as a dendrogram.
o Text Clustering: Uses cosine similarity to organization documents with comparable content
material. This is mainly beneficial in organizing big textual content corpora.
2. Classification
Classification assigns a label to a brand new facts factor based totally at the traits of acknowledged
classified facts points. Similarity measures help decide the label by means of comparing the new
factor to present points.
o K-Nearest Neighbors (k-NN): Classifies a statistics factor primarily based on the majority
label among its ok nearest acquaintances, frequently the usage of Euclidean distance or cosine
similarity.
o Document Classification: Uses similarity measures like cosine similarity to categorize text
files into predefined instructions.
3. Information Retrieval
Information retrieval structures, together with search engines, rely on similarity measures to rank
documents primarily based on their relevance to a query.
o Search Engines: Use cosine similarity to evaluate the question vector with report vectors,
ranking documents by using their similarity to the query.
o Content-Based Filtering: In advice systems, similarity measures (e.g., cosine similarity,
Jaccard similarity) are used to recommend gadgets that might be much like those a user has
previously favored.
4. Recommendation Systems
Recommendation structures suggest items to customers based on their alternatives and behavior,
often the usage of similarity measures to discover objects or customers that might be alike.
o Collaborative Filtering: Uses similarity measures like Pearson correlation or cosine similarity
to locate customers with similar preferences and propose items they've liked.
o Content-Based Filtering: Recommends items similar to those the person has shown interest
in, the use of measures like cosine similarity to examine object capabilities.
o
5. Anomaly Detection
Anomaly detection identifies outliers or uncommon statistics points that differ substantially from the
bulk of information.
o Mahalanobis Distance: Considers the correlations of the dataset to stumble on multivariate
outliers.
o Euclidean Distance: Can be used in easier contexts to locate information factors that are away
from the imply or median of the dataset.
6. Natural Language Processing (NLP)
In NLP, similarity measures are used to examine text data, assisting in responsibilities consisting of
report clustering, plagiarism detection, and sentiment evaluation.
o Word Embeddings: Use cosine similarity to evaluate phrase vectors in fashions like
Word2Vec or GloVe, enabling the identity of semantically comparable words.
o Document Similarity: Measures like cosine similarity assist in clustering files or detecting
plagiarism by comparing text content.
7. Image Processing
Image processing involves analyzing and manipulating pics, where similarity measures are used to
compare picture capabilities.
o Image Retrieval: Uses measures like Euclidean distance on characteristic vectors (e.g., colour
histograms, side descriptors) to discover similar photographs.
o Face Recognition: Employs measures like cosine similarity on feature vectors extracted from
deep studying fashions to become aware of or verify people.
8. Bioinformatics
In bioinformatics, similarity measures help examine organic information, along with genetic
sequences or protein systems.
o Sequence Alignment: Uses Hamming distance to compare DNA, RNA, or protein sequences,
figuring out similarities and variations that could imply evolutionary relationships.
o Protein Structure Comparison: Employs measures like RMSD (Root Mean Square Deviation)
to evaluate 3-D systems of proteins, aiding within the examination of their functions and
interactions.
Dissimilarity Measures
Dissimilarity measures, frequently known as distance metrics, are crucial in data technological know-
how for quantifying the difference among statistics points. These measures assist in obligations
including clustering, type, anomaly detection, and lots of more. By knowledge how unique two
statistics factors are, algorithms can higher arrange, classify, and examine information. Here, we
discover some of the maximum typically used dissimilarity measures, their formulas, descriptions,
and regular programs.
1. Euclidean Distance
o Description: Also referred to as the taxicab or town block distance, Manhattan distance
measures the space among two points by using summing absolutely the variations in their
coordinates. It is useful for high-dimensional information and while the facts dimensions
aren't on the same scale.
o Applications: Used in clustering, in particular while coping with excessive-dimensional
spaces or facts with differing scales.
3. Hamming Distance
o Description: Hamming distance measures the variety of positions at which the corresponding
factors of strings are one of a kind. It is commonly used for categorical facts or binary strings.
o Applications: Common in errors detection and correction algorithms, including in coding
theory and for evaluating binary sequences.
4. Mahalanobis Distance
o Description: Mahalanobis distance measures the gap among a factor and a distribution,
considering the correlations of the information set. It is scale-invariant and useful for
identifying outliers.
o Applications: Used in multivariate anomaly detection, clustering, and category
responsibilities.
5. Chebyshev Distance
o The difference between any unmarried dimension of two data points. It is useful in
eventualities where the most deviation is of interest.
o Applications: Used in certain satisfactory manipulation processes and for programs where the
biggest single difference is the most vital thing.
Applications:
Dissimilarity measures are critical in records science, providing a way to quantify the variations
between information points. These measures are extensively used in numerous packages, from
clustering and classification to anomaly detection and bioinformatics. Here, we explore numerous
key applications of dissimilarity measures.
1. Clustering
In clustering, dissimilarity measures help to outline the boundaries of clusters by quantifying how
exclusive statistics points are from each other.
o K-Means Clustering: Uses Euclidean distance to assign statistics factors to the closest cluster
centroid. Each record factor is assigned to the cluster whose implies yields the least within-
cluster sum of squares.
o Hierarchical Clustering: Can use various distance metrics together with Euclidean,
Manhattan, or Chebyshev distances to build a hierarchy of clusters. The choice of distance
metric can appreciably affect the form and meaning of the ensuing clusters.
2. Classification
Dissimilarity measures help in class responsibilities by way of figuring out the distinction among
records factors, which is vital for assigning labels.
K-Nearest Neighbors (ok-NN): Uses dissimilarity measures like Euclidean distance to categorize a
statistics factor primarily based at the labels of its nearest associates. The facts factor is assigned to
the magnificence most commonplace among its ok nearest buddies.
3. Anomaly Detection
Anomaly detection involves figuring out record points that deviate notably from the norm.
Dissimilarity measures help quantify those deviations.
o Mahalanobis Distance: Effective in multivariate anomaly detection as it considers the
correlations among variables. Points that have an excessive Mahalanobis distance from the
mean are considered outliers.
o Euclidean and Chebyshev Distances: Used to pick out outliers by way of measuring the
distance from the suggestion or different important points in the facts.
4. Information Retrieval
In records retrieval, dissimilarity measures help rank gadgets based on their differences from a query,
helping in the retrieval of the maximum applicable records.
o Euclidean Distance: Can be used to degree the distinction among user possibilities and item
features in advice systems, assisting to signify gadgets that are distinctive from those the
consumer has already seen.
o Hamming Distance: Used in text retrieval to measure the distinction between binary or
express data, which include keywords or tags.
5. Image Processing
In photo processing, dissimilarity measures compare and examine photo functions, which is crucial
for tasks that include photo retrieval and reputation.
o Euclidean Distance: Used in photo retrieval systems to find pix which are visually one-of-a-
kind based on feature vectors, which include color histograms or texture patterns.
o Hamming Distance: Employed in evaluating binary image descriptors, together with those
used in fingerprint matching or optical man or woman reputation.
6. Bioinformatics
In bioinformatics, dissimilarity measures are used to compare organic data, which include genetic
sequences or protein systems, that's critical for understanding biological capabilities and
relationships.
o Hamming Distance: Used in collection alignment to evaluate DNA, RNA, or protein
sequences, helping to discover mutations or evolutionary relationships.
o Euclidean and Mahalanobis Distances: Used to examine protein structures and other high-
dimensional biological statistics, assisting in the study of molecular features and interactions.
7. Quality Control
In manufacturing and pleasant manipulation, dissimilarity measures are used to stumble on
deviations from the same old or predicted product traits.
Chapter-2
and can be interpreted as the ratio of the expected frequency that X occurs without Y
(that is to say, the frequency that the rule makes an incorrect prediction) if X and Y were
independent divided by the observed frequency of incorrect predictions.
This process analyzes customer buying habits by finding associations between the different items
that customers place in their shopping baskets. The discovery of such associations can help
retailers develop marketing strategies by gaining insight into which items are frequently
purchased together by customers. For instance, if customers are buying milk, how likely are they
to also buy bread (and what kind of bread) on the same trip to the supermarket? Such
information can lead to increased sales by helping retailers do selective marketing and plan their
shelf space.
Example:
If customers who purchase computers also tend to buy antivirus software at the same time, then
placing the hardware display close to the software display may help increase the sales of both
items. In an alternative strategy, placing hardware and software at opposite ends of the store may
entice customers who purchase such items to pick up other items along the way. For instance,
after deciding on an expensive computer, a customer may observe security systems for sale while
heading toward the software display to purchase antivirus software and may decide to purchase a
home security system as well. Market basket analysis can also help retailers plan which items to
put on sale at reduced prices. If customers tend to purchase computers and printers together, then
having a sale on printers may encourage the sale of printers as well as computers.
Frequent pattern mining can be classified in various ways, based on the following criteria:
1. Based on the completeness of patterns to be mined:
We can mine the complete set of frequent itemsets, the closed frequent itemsets, and
the maximal frequent itemsets, given a minimum support threshold.
Some methods for association rule mining can find rules at differing levels of abstraction.
For example, suppose that a set of association rules mined includes the following
rules where X is a variable representing a customer:
In rule (1) and (2), the items bought are referenced at different levels of abstraction (e.g.,
―computer‖ is a higher-level abstraction of ―laptop computer‖).
3. Based on the number of data dimensions involved in the rule:
If the items or attributes in an association rule reference only one dimension, then it is
a single-dimensional association rule.
buys(X, ―computer‖))=>buys(X, ―antivirus software‖)
If a rule references two or more dimensions, such as the dimensions of age, income, and
buys, then it is a multidimensional association rule. The following rule is an example of a
multidimensional rule:
Age (X, ―30,31…39‖) ^ income (X, ―42K,48K‖))=>buys(X, ―high resolution TV‖)
4. Based on the types of values handled in the rule:
Frequent pattern analysis can generate various kinds of rules and other interesting
relationships.
Association rule mining can generate a large number of rules, many of which are
redundant or do not indicate a correlation relationship among itemsets.
Sequential pattern mining searches for frequent subsequences in a sequence data set,
where a sequence records an ordering of events.
For example, with sequential pattern mining, we can study the order in which items are
frequently purchased. For instance, customers may tend to first buy a PC, followed by a
digital camera, and then a memory card.
Therefore, structured pattern mining can be considered the most general form of frequent
pattern mining.
2.4 Efficient Frequent Itemset Mining Methods:
The name of the algorithm is based on the fact that the algorithm uses prior knowledge of
frequent itemset properties.
Apriori employs an iterative approach known as a level-wise search, where k-itemsets are
used to explore (k+1)-itemsets.
First, the set of frequent 1-item sets is found by scanning the database to accumulate the
count for each item and collecting those items that satisfy minimum support. The
resulting set is denoted L1. Next, L1 is used to find L2, the set of frequent 2-itemsets,
which is used to find L3, and so on, until no more frequent k-itemsets can be found.
The finding of each Lk requires one full scan of the database.
A two-step process is followed in Apriori consisting of join and prune action.
Example:
For many applications, it is difficult to find strong associations among data items at
low or primitive levels of abstraction due to the sparsity of data at those levels.
Therefore, data mining systems should provide capabilities for mining association
rules at multiple levels of abstraction, with sufficient flexibility for easy traversal
among different abstraction spaces.
Association rules generated from mining data at multiple levels of abstraction are called
multiple-level or multilevel association rules.
Multilevel association rules can be mined efficiently using concept hierarchies under a
support-confidence framework.
A concept hierarchy defines a sequence of mappings from a set of low-level concepts to higher-
level, more general concepts. Data can be generalized by replacing low-level concepts within the
data with their higher-level concepts, or ancestors, from a concept hierarchy.
The concept hierarchy has five levels, respectively referred to as levels 0 to 4, starting with
level 0 at the root node for all.
• Level 1 includes a computer, software, printer & camera, and computer accessory.
• Level 2 includes laptop computers, desktop computers, office software, and antivirus
software
• Level 3 includes IBM desktop computers, Microsoft Office software, and so on.
• Level 4 is the most specific abstraction level of this hierarchy.
Association rules that involve two or more dimensions or predicates can be referred
to as multidimensional association rules.
Age (X, “20…29”) ^occupation (X, “student”) =>buys (X, “laptop”)
The above Rule contains three predicates (age, occupation, and buys), each of which
occurs only once in the rule. Hence, we say that it has no repeated predicates.
We can also mine multidimensional association rules with repeated predicates, which
contain multiple occurrences of some predicates. These rules are called hybrid-
dimensional association rules. An example of such a rule is the following, where the
predicate buys is repeated:
age(X, ―20…29‖)^buys(X, ―laptop‖)=>buys(X, ―HP printer‖)
That is, a correlation rule is measured not only by its support and confidence but also by
the correlation between itemsets A and B. There are many different correlation measures
from which to choose. In this section, we study various correlation measures to determine
which would be good for mining large data sets.
If the lift(A,B) is less than 1, then the occurrence of A is negatively correlated with
the occurrence of B.
If the resulting value is greater than 1, then A and B are positively correlated, meaning that
the occurrence of one implies the occurrence of the other.
If the resulting value is equal to 1, then A and B are independent and there is no correlation
between them.
Chapter-3
Classification and prediction are two forms of data analysis that can be used to extract
models describing important data classes or to predict future data trends.
Classification predicts categorical (discrete, unordered) labels and prediction models
continuous-valued functions.
For example, we can build a classification model to categorize bank loan applications as
either safe or risky, or a prediction model to predict the expenditures of potential
customers on computer equipment given their income and occupation.
A predictor is constructed that predicts a continuous-valued function, or ordered value, as
opposed to a categorical label.
Regression analysis is a statistical methodology that is most often used for numeric
prediction.
Many classification and prediction methods have been proposed by researchers in machine
learning, pattern recognition, and statistics.
Most algorithms are memory residents, typically assuming a small data size. Recent data
mining research has built on such work, developing scalable classification and prediction
techniques capable of handling large disk-resident data.
The accuracy of a classifier refers to the ability of a given classifier to correctly predict
the class label of new or previously unseen data (i.e., tuples without class label
information).
The accuracy of a predictor refers to how well a given predictor can guess the value of
the predicted attribute for new or previously unseen data.
Speed:
This refers to the computational costs involved in generating and using
the given classifier or predictor.
Robustness:
This is the ability of the classifier or predictor to make correct
predictions given noisy data or data with missing values.
Scalability:
This refers to the ability to construct the classifier or predictor efficiently
given large amounts of data.
Interpretability:
This refers to the level of understanding and insight that is provided by the classifier or
predictor.
Interpretability is subjective and therefore more difficult to assess.
3.2 Classification by Decision Tree Induction:
Decision tree induction is the learning of decision trees from class-labeled training
tuples. A decision tree is a flowchart-like tree structure, where
Each internal node denotes a test on an attribute.
Each branch represents an outcome of the test.
Each leaf node holds a class label.
The topmost node in a tree is the root node.
The construction of decision tree classifiers does not require any domain knowledge or
parameter setting, and therefore I appropriate for exploratory knowledge discovery.
Their representation of acquired knowledge in tree form is intuitive and generally easy to
assimilate by humans.
The learning and classification steps of decision tree induction are simple and
fast. In general, decision tree classifiers have good accuracy.
Decision tree induction algorithms have been used for classification in many application
areas, such as medicine, manufacturing and production, financial analysis, astronomy,
and molecular biology.
3.2.1 Algorithm For Decision Tree Induction:
The attribute selection method specifies a heuristic procedure for selecting the attribute
that
―best‖ discriminates the given tuples according to class.
The tree starts as a single node, N, representing the training tuples in D.
If the tuples in D are all of the same class, then node N becomes a leaf and is labeled
with that class.
All of the terminating conditions are explained at the end of the algorithm.
Otherwise, the algorithm calls the Attribute selection method to determine the
splitting criterion.
The splitting criterion tells us which attribute to test at node N by determining ―the best‖
way to separate or partition the tuples in D into individual classes.
There are three possible scenarios. Let A be the splitting attribute. A has v distinct values,
{a1, a2, … ,av}, based on the training data.
1 A is discrete-valued:
In this case, the outcomes of the test at node N correspond directly to the
known values of A.
A branch is created for each known value, a j, of A and labeled with that
value. A need not be considered in any future partitioning of the tuples.
2 A is continuous-valued:
In this case, the test at node N has two possible outcomes, corresponding to the conditions
A <=split point and A >split point, respectively
where the split point is the split point returned by t h e Attribute selection method as
part of the splitting criterion.
They can predict class membership probabilities, such as the probability that a given
tuple belongs to a particular class.
1.Let D be a training set of tuples and their associated class labels. As usual, each tuple is
represented by an n-dimensional attribute vector, X = (x1, x2, …,xn), depicting n
measurements made on the tuple from n attributes, respectively, A1, A2, …, An.
2. Suppose that there are m classes, C1, C2, …, Cm. Given a tuple, X, the classifier will
predict that X belongs to the class having the highest posterior probability, conditioned on X.
That is, the naïve Bayesian classifier predicts that tuple X belongs to the class Ci if and only
if
Thus we maximize P(CijX). The class Ci for which P(CijX) is maximized is called
the maximum posterior hypothesis. By Bayes’ theorem
3.As P(X) is constant for all classes, only P(X|Ci)P(Ci) need be maximized. If the class
prior probabilities are not known, then it is commonly assumed that the classes are equally
likely, that is, P(C1) = P(C2) = …= P(Cm), and we would therefore maximize P(X|Ci).
Otherwise, we maximize P(X|Ci) P(Ci).
4. Given data sets with many attributes, it would be extremely computationally
expensive to compute P(X|Ci). To reduce computation in evaluating P(X|Ci), the naive
assumption of class conditional independence is made. This presumes that the values of the
attributes are unconditionally independent of one another, given the class label of the tuple.
Thus,
We can easily estimate the probabilities P(x1|Ci), P(x2|Ci),.., P(xn|Ci) from the training
tuples. For each attribute, we look at whether the attribute is categorical or continuous-
valued. For instance, to compute P(X|Ci), we consider the following:
If Akis categorical, then P(xk|Ci) is the number of tuples of class Ciin D having the value
xk for Ak, divided by |Ci,D| the number of tuples of class Ciin D.
If Akis continuous-valued, then we need to do a bit more work, but the calculation is
pretty straightforward.
A continuous-valued attribute is typically assumed to have a Gaussian distribution with
a mean μ and standard deviation, defined by
5.To predict the class label of X, P(XjCi)P(Ci) is evaluated for each class Ci. The
classifier predicts that the class label of tuple X is the class Ciif and only if
The inputs to the network correspond to the attributes measured for each training tuple. The
inputs are fed simultaneously into the units making up the input layer. These inputs pass
through the input layer and are then weighted and fed simultaneously to a second layer
known as a hidden layer.
The outputs of the hidden layer units can be input to another hidden layer, and so on. The
number of hidden layers is arbitrary.
The weighted outputs of the last hidden layer are input to units making up the output layer,
which emits the network’s prediction for given tuples
In other words, for each numeric attribute, we take the difference between the corresponding
values of that attribute in tuple X1 and tuple X2, square this difference, and accumulate it.
The square root is taken from the total accumulated distance count.
Min-Max normalization can be used to transform the value v of a numeric attribute A to
v0 in the range [0, 1] by computing
wherein and max are the minimum and maximum values of attribute A
The accuracy of a classifier on a given test set is the percentage of test set tuples that are
correctly classified by the classifier.
In the pattern recognition literature, this is also referred to as the overall recognition rate of
the classifier, that is, it reflects how well the classifier recognizes tuples of the various
classes.
The confusion matrix is a useful tool for analyzing how well your classifier can recognize
tuples of different classes.
True positives refer to the positive tuples that were correctly labeled by the
classifier. True negatives are the negative tuples that were correctly labeled by the
classifier.
False positives are the negative tuples that were incorrectly labeled.
How well the classifier can recognize, for this sensitivity and specificity measures can be
used.
Accuracy is a function of sensitivity and specificity.
The process of grouping a set of physical or abstract objects into classes of similar
objects is called clustering.
A cluster is a collection of data objects that are similar to one another within the
same cluster and are dissimilar to the objects in other clusters.
A cluster of data objects can be treated collectively as one group and so may be considered
as a form of data compression.
Cluster analysis tools based on k-means, k-medoids, and several methods have also been
built into many statistical analysis software packages or systems, such as S-Plus, SPSS, and
SAS.
4.1.1 Applications:
Cluster analysis has been widely used in numerous applications, including market
research, pattern recognition, data analysis, and image processing.
In business, clustering can help marketers discover distinct groups in their customer bases
and characterize customer groups based on purchasing patterns.
In biology, it can be used to derive plant and animal taxonomies, categorize genes with
similar functionality, and gain insight into structures inherent in populations.
Clustering may also help in the identification of areas of similar land use in an earth
observation database and the identification of groups of houses in a city according to house
type, value, and geographic location, as well as the identification of groups of automobile
insurance policyholders with a high average claim cost.
The general criterion of a good partitioning is that objects in the same cluster are close or
related to each other, whereas objects of different clusters are far apart or very different.
The agglomerative approach, also called the bottom-up approach, starts with each object
forming a separate group. It successively merges the objects or groups that are close to
one another, until all of the groups are merged into one or until a termination condition
holds.
The divisive approach, also called the top-down approach, starts with all of the objects in
the same cluster. In each successive iteration, a cluster is split up into smaller clusters,
until eventually each objects in one cluster, or until a termination condition holds.
Hierarchical methods suffer from the fact that once a step (merge or split) is done, it can
never be undone. This rigidity is useful in that it leads to smaller computation costs by not
having to worry about a combinatorial number of different choices.
For each of the remaining objects, an object is assigned to the cluster to which it is
the most similar, based on the distance between the object and the cluster mean.
where is the sum of the square error for all objects in the data set
is the point in space representing a given object
mi is the mean of cluster Ci
A hierarchical clustering method works by grouping data objects into a tree of clusters.
The quality of a pure hierarchical clustering method suffers from its inability to perform
adjustment once an emerge or split decision has been executed. That is, if a particular
merge or split decision later turns out to have been a poor choice, the method cannot
backtrack and correct it.
Most hierarchical clustering methods belong to this category. They differ only in their
definition of inter cluster similarity.
We can specify constraints on the objects to be clustered. In a real estate application, for
example, one may like to spatially cluster only those luxury mansions worth over a million
dollars. This constraint confines the set of objects to be clustered. It can easily be
handled by preprocessing after which the problem reduces to an instance of unconstrained
clustering.
A user may like to set a desired range for each clustering parameter. Clustering parameters
are usually quite specific to the given clustering algorithm. Examples of parameters include
k, the desired number of clusters in a k-means algorithm; or the radius and the minimum
number of points in the DBSCAN algorithm. Although such user-specified parameters may
strongly influence the clustering results, they are usually confined to the algorithm itself.
Thus, their fine-tuning and processing are usually not considered a form of constraint-based
clustering.
Constraints on distance or similarity functions:
We can specify different distance or similarity functions for specific attributes of the
objects to be clustered, or different distance measures for specific pairs of objects. When
clustering sportsmen, for example, we may use different weighting schemes for height,
body weight, age, and skill level. Although this will likely change the mining results, it
may not alter the clustering process per se. However, in some cases, such changes may
make the evaluation of the distance function nontrivial, especially when it is tightly
intertwined with the clustering process.
User-specified constraints on the properties of individual clusters:
A user may like to specify the desired characteristics of the resulting clusters, which may
strongly influence the clustering process.
Semi-supervised clustering based on partial supervision:
The quality of unsupervised clustering can be significantly improved using some weak
form of supervision. This may be in the form of pairwise constraints (i.e., pairs of objects
labeled as belonging to the same or different cluster). Such a constrained clustering process
is called semi-supervised clustering.
4.6 Outlier Analysis:
There exist data objects that do not comply with the general behavior or model of the data.
Such data objects, which are grossly different from or inconsistent with the remaining set
of data, are called outliers.
Many data mining algorithms try to minimize the influence of outliers or eliminate them.
This, however, could result in the loss of important hidden information because one
person’s noise could be another person’s signal. In other words, the outliers may be of
particular interest, such as in the case of fraud detection, where outliers may indicate
fraudulent activity. Thus, outlier detection and analysis is an interesting data mining task,
referred to as outlier mining.
It can be used in fraud detection, for example, by detecting unusual usage of credit cards or
telecommunication services. In addition, it is useful in customized marketing for
identifying the spending behavior of customers with extremely low or extremely high
incomes, or in medical analysis for finding unusual responses to various medical
treatments.
Outlier mining can be described as follows: Given a set of n data points or objects and k, the
expected number of outliers, find the top k objects that are considerably dissimilar,
exceptional, or inconsistent concerning the remaining data. The outlier mining problem can
be viewed as two subproblems:
cells thick, rounded up to the closest integer. The algorithm counts outliers on a
cell-by-cell rather than an object-by-object basis. For a given cell, it accumulates three counts
—the number of objects in the cell, in the cell and the first layer together, and in the cell and
both layers together. Let’s refer to these counts as cell count, cell + 1 layer count, and cell + 2
layers count, respectively.
Let M be the maximum number of outliers that can exist in the neighborhood of an outlier.
An object, o, in the current cell is considered an outlier only if cell + 1 layer count is less
than or equal to M. If this condition does not hold, then all of the objects in the cell can
be removed from further investigation as they cannot be outliers.
If cell_+ 2_layers_count is less than or equal to M, then all of the objects in the cell are
considered outliers. Otherwise, if this number is more than M, then some of the objects in
the cell may be outliers. To detect these outliers, object-by-object processing is used
where, for each object, o, in the cell, objects in the second layer of o are examined. For
objects in the cell, only those objects having no more than M points in their d min-
neighborhoods are outliers. The d min-neighborhood of an object consists of the
object’s cell, all of its first layer, and some of its second layer.
A variation to the algorithm is linear concerning n and guarantees that no more than three
passes over the data set are required. It can be used for large disk-resident data sets, yet does
not scale well for high dimensions.
That is, there are at most k-1 objects that are closer to p than o. You may be wondering at this
point how k is determined. The LOF method links to density-based clustering in that it sets k
to the parameter rMinPts, which specifies the minimum number of points for use in
identifying clusters based on density.
Here, MinPts (as k) is used to define the local neighborhood of an object, p.
The k-distance neighborhood of an object p is denoted N kdistance(p)(p), or Nk(p)for short. By
setting k to MinPts, we get N MinPts(p). It contains the MinPts-nearest neighbors of p. That is, it
contains every object whose distance is not greater than the MinPts-distance of p.
The reachability distance of an object p concerning object o (where o is within the
theMinPts-nearest neighbors of p), is defined as reach
distMinPts(p, o) = max{MinPts distance(o), d(p, o)}.
Intuitively, if an object p is far away, then the reachability distance between the two is simply
their actual distance. However, if they are sufficiently close (i.e., where p is within the
MinPts-distance neighborhood of o), then the actual distance is replaced by the MinPts-
distance of o. This helps to significantly reduce the statistical fluctuations of d(p, o) for all of
the p close to o.
The higher the value of MinPts is, the more similar the reachability distance for objects
within the same neighborhood.
Intuitively, the local reachability density of p is the inverse of the average reachability
density based on the MinPts-nearest neighbors of p. It is defined as
The local outlier factor (LOF) of p captures the degree to which we call p an outlier.
It is defined as
It is the average of the ratio of the local reachability density of p and those of p’s
MinPts-nearest neighbors. It is easy to see that the lower p’s local reachability density
is, and the higher the local reachability density of p’s MinPts-nearest neighbors are,
the higher LOF(p) is.
4.6.4 Deviation-Based Outlier Detection:
Deviation-based outlier detection does not use statistical tests or distance-based measures to
identify exceptional objects. Instead, it identifies outliers by examining the main
characteristics of objects in a group. Objects that ―deviate‖ from this description are
considered outliers. Hence, in this approach, the term deviations is typically used to refer to
outliers. In this section, we study two techniques for deviation-based outlier detection. The
first sequentially compares objects in a set, while the second employs an OLAP data cube
approach.
Dissimilarities are assessed between subsets in the sequence. The technique introduces the
following key terms.
Exception set:
This is the set of deviations or outliers. It is defined as the small subset of objects whose
removal results in the greatest reduction of dissimilarity in the residual set.
Dissimilarity function:
This function does not require a metric distance between the objects. It is any function that, if
given a set of objects, returns a low value if the objects are similar to one another. The
greater the dissimilarity among the objects, the higher the value returned by the function. The
dissimilarity of a subset is incrementally computed based on the subset before it in the
sequence. Given a subset of n numbers, {x1, …,xn}, a possible dissimilarity function is the
variance of the numbers in the set, that is,
where x is the mean of the n numbers in the set. For character strings, the dissimilarity function
may be in the form of a pattern string (e.g., containing wildcard characters that is used to cover
all of the patterns seen so far. The dissimilarity increases when the pattern covering all of the
strings in Dj-1 does not cover any string in Dj that is not in Dj-1.
Cardinality function:
This is typically the count of the number of objects in a given set.
Smoothing factor:
This function is computed for each subset in the sequence. It assesses how much the
dissimilarity can be reduced by removing the subset from the original set of objects.