An interactive web application to visualize the Pearson correlation coefficient (r) using Streamlit. The app generates linear, nonlinear, and random datasets, calculates correlation values, and provides graphical representations with regression lines.
🔗 Live Demo: Bravais-Pearson Interactive
🔗 GitHub Repository: noluyorAbi/Bravais-Pearson-Interactive
- 📈 Visualize Linear, Quadratic, and Random Relationships
- 🔢 Interactive Parameter Controls for correlation strength, noise, and sample size
- 🧮 Manually Implemented Pearson Correlation Calculation
- 🏹 Real-time Scatter Plots with Regression Lines
- 📊 Statistical Metrics: Pearson’s r,
$r^2$ (coefficient of determination), and p-value - 🎨 Seaborn & Matplotlib Styling for Clean Data Visualization
1️⃣ Clone the repository:
git clone https://github.com/noluyorAbi/Bravais-Pearson-Interactive.git
cd Bravais-Pearson-Interactive
2️⃣ Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
3️⃣ Install dependencies:
pip install -r requirements.txt
Run the Streamlit app:
streamlit run interactive.py
.
├── examples.py # Example scripts for correlation calculations
├── interactive.py # Main Streamlit application
└── requirements.txt # Dependencies for the project
The Pearson correlation coefficient (r) is a measure of the linear relationship between two variables:
Interpretation of r:
-
$r = 1$ : Perfect positive correlation -
$r = -1$ : Perfect negative correlation -
$r = 0$ : No correlation
numpy
matplotlib
scipy
seaborn
streamlit
Install all dependencies via:
pip install -r requirements.txt
If you’d like to contribute, feel free to fork the repository and submit a pull request! 🚀