An interactive web-based tool to explore and visualize regression concepts, built using HTML, CSS, and JavaScript. This application provides an intuitive and engaging experience for learning linear and polynomial regression.
The Interactive Regression Application is designed to help users understand regression concepts interactively. By plotting points on a canvas and fitting linear or polynomial regression curves, users can dynamically see the corresponding equations, Mean Squared Error (MSE), and how the models adjust to changes in the data. This tool is ideal for students, educators, and data enthusiasts.
-
Interactive Point Plotting:
- Add points by clicking on the canvas.
- Points can be dynamically updated and removed.
-
Regression Curve Fitting:
- Linear Regression:
- Fit a straight line (y = mx + b) using the least-squares method.
- Polynomial Regression:
- Fit a polynomial curve (up to degree 5) by selecting the degree from a dropdown menu.
- Linear Regression:
-
MSE Calculation:
- Displays MSE for both linear and polynomial regressions for easy comparison.
-
Dynamic Equation Display:
- Real-time equations for linear and polynomial regression are displayed on the canvas.
-
Reset Functionality:
- Clear the canvas, reset points, equations, and MSE to start fresh.
-
Responsive Design:
- Optimized for various screen sizes and devices.
-
Plot Points:
- Click anywhere on the canvas to add points.
- Points dynamically update the regression models.
-
Select Regression Type:
- Use the dedicated buttons to fit a linear or polynomial regression model.
- Select the degree of the polynomial (2 to 5) using the dropdown menu.
-
View Results:
- Equations for the regression models are displayed on the canvas.
- MSE values for both models are displayed above the controls.
-
Reset:
- Click the "Start Again" button to reset the canvas and begin a new session.
- Interactive canvas with a structured grid layout for easy visualization of data points and regression curves.
- Buttons for fitting linear or polynomial regressions.
- Dropdown menu to select the degree of polynomial regression.
- A "Start Again" button to reset the session.
- Displays real-time updates of regression equations and MSE values for both linear and polynomial models.
- HTML: Provides the structure of the web page.
- CSS: Adds styling and responsiveness to the user interface.
- JavaScript: Implements interactivity, regression calculations, and MSE computation.
- Math.js: Handles matrix operations for polynomial regression.
-
Clone the Repository:
git clone https://github.com/yourusername/interactive-regression-app.git
-
Navigate to the Project Directory:
cd interactive-regression-app -
Open the Application:
- Open the
index.htmlfile in a web browser.
- Open the
-
Start Exploring:
- Interact with the canvas, fit regression models, and explore the features.
Feel free to contribute to this project by creating pull requests or submitting issues. Let's make learning regression more interactive and fun!