A machine learning project to predict taxi fares using ML.NET. This solution includes end-to-end data preprocessing, training, evaluation, and prediction, designed for both learning and practical deployment.
This project leverages ML.NET's FastTree regression algorithm to predict taxi fares based on features such as trip distance, passenger count, and payment type. The implementation extends the official ML.NET sample.
- Data Cleaning & Preprocessing: Handles missing values, outliers, and normalization.
- Custom Reports: Generate detailed insights like missing values, distinct value counts, and frequency distributions.
- Advanced ML Pipeline: Combines categorical encoding, normalization, and feature engineering for robust predictions.
- Save & Reuse Models: Serialize the trained model for future predictions.
Prerequisites
- .NET 6 SDK or later.
- A dataset for taxi fare prediction (example:
taxi-fare-full.csv
).
Running the Project
- Clone the repository:
git clone https://github.com/girgisadel/RegressionUsingCsharp.git
cd taxi-fare-prediction
- Build and run the application:
dotnet build
dotnet run
- View outputs such as data reports, training progress, and evaluation metrics directly in the console.
The model achieves high accuracy in predicting taxi fares, evaluated against metrics such as:
- R2 Score: Measures the proportion of variance captured by the model.
- RMSE (Root Mean Squared Error): Quantifies prediction error.
This project builds on the ML.NET Samples.