Outlier (Data): Difference between revisions

From CS Wiki
(새 문서: '''Outlier''' refers to a data point that significantly deviates from other observations in a dataset. Outliers can arise due to variability in the data, errors in measurement, or rare events. Identifying and addressing outliers is critical in data preprocessing, as they can influence statistical analyses and machine learning models. ==Characteristics of Outliers== Outliers exhibit the following traits: *'''Deviation from Patterns:''' They do not conform to the general distribut...)
 
(Outlier (Data Science) 문서로 넘겨주기)
Tag: New redirect
 
Line 1: Line 1:
'''Outlier''' refers to a data point that significantly deviates from other observations in a dataset. Outliers can arise due to variability in the data, errors in measurement, or rare events. Identifying and addressing outliers is critical in data preprocessing, as they can influence statistical analyses and machine learning models.
#넘겨주기 [[Outlier (Data Science)]]
==Characteristics of Outliers==
Outliers exhibit the following traits:
*'''Deviation from Patterns:''' They do not conform to the general distribution of the data.
*'''Influence on Metrics:''' They can skew summary statistics like mean and standard deviation.
*'''Rare Occurrence:''' Outliers are infrequent compared to typical data points.
==Types of Outliers==
Outliers are broadly categorized into:
*'''Univariate Outliers:''' Extreme values observed in a single variable.
**Example: A test score of 150 in a dataset where the range is 0–100.
*'''Multivariate Outliers:''' Data points that are unusual when considering relationships between multiple variables.
**Example: A combination of height and weight that is inconsistent with other observations.
==Causes of Outliers==
Outliers can arise due to several reasons:
*'''Data Entry Errors:''' Mistakes during data recording or input.
*'''Instrument Errors:''' Malfunctions in devices collecting the data.
*'''Natural Variability:''' Genuine data points that are rare but valid.
*'''Sampling Issues:''' Data collected from a non-representative population.
==Identifying Outliers==
Common techniques for identifying outliers include:
*'''Statistical Methods:'''
**Z-Score: Calculates how far a data point is from the mean in terms of standard deviations. Typically, points with |Z| > 3 are considered outliers.
**Interquartile Range (IQR): Identifies outliers as points lying outside the range \([Q1 - 1.5 \times IQR, Q3 + 1.5 \times IQR]\).
*'''Visualization:'''
**Box Plots: Show data distribution and highlight potential outliers.
**Scatter Plots: Reveal relationships between variables and outliers.
*'''Machine Learning Methods:'''
**Isolation Forest: Learns patterns in data and isolates anomalies.
**DBSCAN: Identifies outliers as points that do not belong to any cluster.
==Example of Outlier Detection in Python==
Using IQR to detect outliers:<syntaxhighlight lang="python">
import numpy as np
 
# Example dataset
data = np.array([10, 12, 14, 15, 16, 18, 100])
 
# Calculate Q1, Q3, and IQR
Q1 = np.percentile(data, 25)
Q3 = np.percentile(data, 75)
IQR = Q3 - Q1
 
# Define outlier boundaries
lower_bound = Q1 - 1.5 * IQR
upper_bound = Q3 + 1.5 * IQR
 
# Identify outliers
outliers = data[(data < lower_bound) | (data > upper_bound)]
print("Outliers:", outliers)
</syntaxhighlight>
==Handling Outliers==
Methods for addressing outliers depend on the context:
*'''Removing Outliers:''' Suitable when outliers are caused by errors or are irrelevant.
*'''Transforming Data:''' Applying transformations (e.g., log or square root) to reduce the impact of outliers.
*'''Using Robust Methods:''' Employ algorithms that are less sensitive to outliers, such as median-based statistics or robust regression.
*'''Separating Outliers:''' Treat outliers as a separate class for anomaly detection tasks.
==Applications==
Outlier detection and handling are critical in many fields:
*'''Fraud Detection:''' Identifying unusual transactions or behaviors in finance.
*'''Quality Control:''' Detecting defective products in manufacturing.
*'''Healthcare:''' Recognizing rare medical conditions or measurement errors.
*'''Environmental Science:''' Spotting unusual environmental readings, such as temperature spikes.
==Advantages==
*'''Improved Model Accuracy:''' Removing or addressing outliers helps prevent skewed results.
*'''Better Data Integrity:''' Ensures datasets represent realistic scenarios.
*'''Enhanced Insights:''' Identifying outliers can reveal meaningful anomalies.
==Limitations==
*'''Context Dependency:''' Not all outliers are irrelevant; some may represent significant findings.
*'''Risk of Information Loss:''' Removing valid outliers may lead to loss of critical information.
*'''Computational Cost:''' Advanced outlier detection methods can be resource-intensive.
==Related Concepts and See Also==
*[[Anomaly Detection]]
*[[Data Cleaning]]
*[[Z-Score]]
*[[Interquartile Range]]
*[[Machine Learning]]
*[[Box Plot]]
[[분류:Data Science]]

Latest revision as of 23:11, 1 December 2024