Git Product home page Git Product logo

taxi-fare-prediction's Introduction

New York Taxi-Fare Prediction

This project aims to predict the taxi fares of New York using linear regression. The dataset was taken from Kaggle.

Dataset

The dataset used in this project contains information about taxi rides in New York, including pickup and dropoff locations, number of passengers, and fare amount.

Preprocessing

Before building the linear regression model, the dataset underwent some preprocessing steps. These included:

  • Removing rows with missing values
  • Removing rows with fare amount less than $2.5 or greater than $200 (to remove outliers)
  • Removing rows with passenger count less than 1 or greater than 6 (to remove outliers)
  • Converting the pickup datetime to separate columns for year, month, day, hour, and minute.

Model Building

The model was built using linear regression. The model takes in the pickup and drop-off locations, the pickup datetime, and the passenger count as input and predicts the fare amount.

The model was trained on 80% of the dataset and tested on the remaining 20%. The mean squared error (MSE) was used as the evaluation metric.

Results

The results of the model show a strong correlation between the input features and taxi fares. The model can be used to predict fares for new taxi rides with a reasonable degree of accuracy.

Usage

To use this project, simply clone the repository and run the NYC_fare_prediction_12040580.ipynb notebook. This notebook contains the code for preprocessing the dataset, building the linear regression model, and evaluating the model.

Conclusion

This project demonstrates the use of linear regression to predict taxi fares in New York. The model can be used to help taxi companies optimize their pricing strategies and provide more accurate fare estimates to customers.With further improvements to the preprocessing steps and feature engineering, the model's accuracy could be improved even further.

taxi-fare-prediction's People

Contributors

satyaswarup11 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.