https://github.com/oniani/lr
Linear Regression from scratch in Rust
https://github.com/oniani/lr
linear-regression ndarray rust
Last synced: about 1 month ago
JSON representation
Linear Regression from scratch in Rust
- Host: GitHub
- URL: https://github.com/oniani/lr
- Owner: oniani
- License: mit
- Created: 2021-05-03T02:05:06.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-07T03:29:04.000Z (about 5 years ago)
- Last Synced: 2025-10-30T03:09:04.407Z (9 months ago)
- Topics: linear-regression, ndarray, rust
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lr
Linear Regression from scratch in Rust.
## Dependencies
- [ndarray](https://docs.rs/ndarray/0.15.1/ndarray/)
## Example
```rust
// Construct a linear regression on the data with 1000 iterations and
// the learning rate of 0.00002
let mut lr = LinearRegression::new(features, labels, 1_000, 2e-5);
// Fit the model
lr.fit();
// Make predictions
let preds = lr.predict(&data);
```
## References
- [ndarray](https://docs.rs/ndarray/0.15.1/ndarray/)
- [Linear regression](https://en.wikipedia.org/wiki/Linear_regression)
## License
[MIT License](LICENSE)