This project consists of a simple implementation of a linear regression algorithm in JavaScript. The objective is to predict car prices based on their mileage.
- Price Prediction: Use the trained algorithm to predict the price of a car based on its mileage.
- Model Training: Train the model using a provided dataset to adjust the parameters of linear regression.
- Data Visualization: Plot a graph illustrating the relationship between mileage and car prices.
- Install Dependencies: Make sure you have Node.js installed on your machine.
- Clone the Repository: Clone this repository to your local machine using the following command:
git clone https://github.com/AxelFdez/linear_regression.git- Predict Car Price: Launch the prediction program by running the following command:
node estimatePrice.jsFollow the prompts to enter the mileage of the car and get a price estimation. 4. Train the Model: Launch the training program by running the following command:
node train.jsThe linear regression algorithm will be trained on the provided data. 5. Visualize Data: To visualize the data, running the following command:
node drawGraph.jsthen, open the graph.html file in your web browser.
6. Test Algorithm Performance: To test the algorithm, running the following command:
node iaPerformance.jsFollow the prompts to enter the learningRate and iterations to get the errorRate.
Thank you for checking out this project!
Feel free to reach out if you have any questions or feedback.
Axel Fernandez