Coder Social home page Coder Social logo

omaradlii / car-price-prediction Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 28 KB

Car Price Prediction is a machine learning project aimed at developing a model that can predict the selling price of used cars based on various features or attributes.

Jupyter Notebook 100.00%
data-science matplotlib pandas seaborn shallow-neural-network

car-price-prediction's Introduction

Car-Price-Prediction

Import Libraries: The code begins by importing necessary libraries such as pandas, numpy, matplotlib, seaborn, and TensorFlow.

Read Data: It reads the car price data from the 'train.csv' file using pandas and stores it in the 'data' dataframe.

Data Preprocessing: The data is then converted to TensorFlow tensors and shuffled randomly.

Train-Validation-Test Split: The dataset is split into training, validation, and test sets based on predefined ratios (TRAIN_RETIO, VAL_RETIO, and TEST_RETIO).

Create TensorFlow Datasets: TensorFlow datasets are created from the training and validation data to facilitate batch processing during training.

Normalization: The input data (features) is normalized using TensorFlow's Normalization layer to scale the values between 0 and 1, which helps improve training performance.

Model Architecture: The neural network model is defined using the Sequential API from TensorFlow. The model consists of an input layer, a normalization layer, three hidden Dense layers with ReLU activation functions, and an output Dense layer with one unit for predicting car prices.

Model Compilation: The model is compiled using the Adam optimizer with a learning rate of 0.1 and Mean Absolute Error (MAE) as the loss function. The Root Mean Squared Error (RMSE) is used as an additional metric to monitor model performance during training.

Model Training: The model is trained using the 'fit' method on the training dataset, and the validation dataset is used for validation during training. The training is performed for 100 epochs, and the training and validation loss and RMSE are recorded for each epoch.

Visualization: The training and validation loss are plotted to visualize the model's learning progress over epochs. Similarly, the training and validation RMSE values are plotted to assess the model's performance.

Evaluation: The model is evaluated on the test dataset using the 'evaluate' method, and the results (loss and RMSE) are printed.

Prediction: A single prediction is made using the trained model on the first example in the test dataset, and the actual value from the test dataset is also displayed.

Visualization of Predictions: Finally, a bar chart is created to compare the predicted car prices (y_pred) and the actual car prices (y_true) for the first 100 examples in the test dataset.

car-price-prediction's People

Contributors

omaradlii avatar

Watchers

 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.