This project implements a linear regression model in Rust, capable of fitting a line to a set of data points and making predictions based on the learned model.
- import data from csv files
- create model trait structure
- create lineal regression model with one variable
- gradient_descent algorithm
- Dataset loading: Loads data from CSV files using a custom
DataSetstruct. - Model training: Trains a linear regression model using gradient descent with configurable options for epochs and learning rate.
- Prediction: Uses the trained model to make predictions on new input data.
- Ensure Rust is installed: Follow the official Rust installation guide: https://www.rust-lang.org/tools/install
- Clone this repository:
git clone https://github.com/your-username/linear-regression-project - Navigate to the project directory:
cd linear-regression-project - Run the project:
cargo run
- src/main.rs: Contains the main entry point of the project.
- src/libs/dataset/lineal_dataset.rs: Defines the
DataSetstruct for handling data. - src/libs/newton/lineal_regression.rs: Implements the
LinealRegressionmodel and training logic. - src/libs/newton/model.rs: Contains a generic
Modeltrait for machine learning models.
- data.csv: Stores the training data in CSV format.
- test.csv: Stores the test data for evaluation.
- LinealRegressionOptions in
main.rsallows adjusting training parameters.
- README.md: This file (provides more detailed information about the project).
We welcome contributions! Please feel free to open issues or pull requests to suggest improvements or fix any issues.
This project is licensed under the MIT License.