This project focuses on analyzing and identifying the key factors that impact latency in Wi-Fi networks. Latency, measured in milliseconds, plays a critical role in the user experience for real-time applications such as video calls, online gaming, and streaming. The analysis uses real-world data collected from various Wi-Fi client connections to explore correlations, trends, and dependencies using statistical techniques and information theory.
- Clean and preprocess Wi-Fi performance data
- Visualize latency distribution across categorical and numerical features
- Identify linear relationships via correlation analysis
- Transform and bin data for structured interpretation
- Compute and rank mutual information to quantify feature importance
- Provide actionable insights for network optimization
The dataset used in this project includes measurements from client connections to Wi-Fi access points. Each row represents a unique connection snapshot. Key features include:
| Feature | Description |
|---|---|
latency_ms |
Measured network latency in milliseconds |
rssi_dbm |
Received signal strength in dBm |
snr_db |
Signal-to-noise ratio in dB |
channel_util% |
Channel utilization percentage |
num_assoc_devices |
Number of devices connected to the AP |
client_speed_mbps |
Reported client connection speed in Mbps |
distance_m |
Estimated distance between client and AP |
band |
Frequency band (e.g., 2.4GHz or 5GHz) |
protocol |
Wi-Fi protocol (e.g., 802.11n, 802.11ac) |
ap_vendor |
Access point vendor |
- Preprocessing: Data cleaning, outlier removal (IQR method), and logical filtering
- Categorical Analysis: Boxplots showing latency distribution per category (band, protocol, vendor)
- Numerical Analysis: Trend plots showing latency vs. binned numerical features
- Correlation Matrix: Pearson correlation between numeric and encoded categorical features
- Log Transformation: Histogram of
log(1 + latency_ms)to normalize distribution - Mutual Information: Manual computation of MI scores to assess feature relevance
- IQR-based Outlier Removal: Filters extreme values beyond 1.5 * IQR
- KBinsDiscretizer: Discretizes continuous features into uniform bins
- Label Encoding: Transforms categorical variables into integers
- Mutual Information: Quantifies nonlinear dependencies between features and target
- Seaborn & Matplotlib: Used extensively for visual exploration
- Top Features Impacting Latency:
snr_dbdistance_mrssi_dbm
- Features like
channel_util%andnum_assoc_devicesalso show moderate influence. - Categorical features such as
bandandprotocolshow limited predictive power.
Mutual Information heatmaps and bar charts confirmed that physical signal characteristics are the strongest predictors of latency.
Note: The csv file is just a sample file and it is generated by script so it is not real data.
This project uses uv as the Python package manager. You must have uv installed to set up the environment.
To install uv, follow the instructions at: https://github.com/astral-sh/uv
Then run:
uv venv
source .venv/bin/activate or .venv\Scripts\activate on Windows
uv syncRequired Python packages:
- pandas
- numpy
- matplotlib
- seaborn
- scikit-learn
- Clone the repository or download the code.
- Place the
wifi_latency.csvdataset in the root directory. - Activate the virtual environment created by
uv. - Run the main script in your Python environment.
- Diagnosing network performance issues
- Building machine learning models for latency prediction
- Optimizing Wi-Fi infrastructure (AP placement, protocol choice, etc.)
- Enhancing Quality of Service (QoS) monitoring systems
For questions, feedback, or contributions, please open an issue or contact the project maintainer.