Posts

Building a Linear Regression PWA with React

Image
  From a CSV file to an interactive chart, entirely in the browser Linear regression is one of the simplest statistical techniques, but it is also a useful example of how data processing, mathematics and visualization can be combined in a modern web application. In this project, I built a Progressive Web App with React that allows users to upload a CSV file containing pairs of X and Y values. The application processes the data, calculates a linear regression model, displays the resulting equation and plots both the original observations and the regression line. The technology stack The application was created with React and Vite. A few focused libraries handle the main features: Papa Parse   reads and processes the uploaded CSV file. Chart.js   and   react-chartjs-2   display the dataset and regression line. KaTeX   renders the regression equation in mathematical notation. vite-plugin-pwa   adds the web app manifest, service worker and installable P...