Diamond Project

This project is an end-to-end implementation of a ML model used to predict the prize of a diamond based on its various features.


Diamond is highly valued in our society. It is seen as a sign of nobility. However, we don't know more about different features of diamond. We only know about carat, but not in depth. Hence let's discuss about the different features of diamond used in our project:

  1. Carat : 1 carat is equal to 200mg. Further, 1 carat is divided into 100 division. carat.jpg
  2. Cut : Cut refers the way the diamond is shaped. It has a large impact of the brilliance(shining). cut.jpg
  3. Clarity : It refers to the amount of blemishes, different types of clarity :
    1. Flawless (FL) No inclusions and no blemishes visible under 10x magnification
    2. Internally Flawless (IF) No inclusions visible under 10x magnification
    3. Very, Very Slightly Included (VVS1 and VVS2) Inclusions so slight they are difficult for a skilled grader to see under 10x magnification
    4. Very Slightly Included (VS1 and VS2) Inclusions are observed with effort under 10x magnification, but can be characterized as minor
    5. Slightly Included (SI1 and SI2) Inclusions are noticeable under 10x magnification
    6. Included (I1, I2, and I3) Inclusions are obvious under 10x magnification which may affect transparency and brilliance clarity.jpg In our dataset, we have only I1,IF,VS1,VS2,VVS1,VVS2,SI1 and SI2.
  4. Colour : Colour actually means lack of colour in diamond. The used dataset has colours D-J (best to worst). colour.jpg
  5. Dimensions : The lenght, width and height of diamond(x,y and z respectively).
  6. Depth and table : These two are related to dimension. Depth is the ratio of z with mean of x and y. Depth = z/mean(x,y). Table is width of diamond relative to its widest point. depth_and_table.jpg

Click here to download the dataset and see it first.

Model Performance

The model has an accuracy of 97% on the test dataset used in the project.


The python version used in this project is 3.8.x.

  • Python Libraries used in project:

    1. Pandas
    2. Numpy
    3. Scikit-Learn
    4. Pycountry
    5. Email-validator
  • The webpage is made using HTML, CSS and Flask framework. The Flask framework has the follwing packages:

    1. Flask-SQLAlchemy
    2. Flask-Inputs
    3. Flask-Login
    4. Flask-WTF

Executing program

After installing all the dependencies, execute the run.py file and the site will open at localhost:5000. The home page of the website will open.

Snippets from the website

Since this website was made for the hackathon "Aye Aye Hackers", hence it has a pirate theme.

  1. First page of the website
  2. Login Page
  3. Home Page
  4. Update Info page
  5. Result page
  6. Creators' Info ## Authors

Contributor names and contact info

Biplov Pokhrel

GitHub : @pbplop29

Email : pbplob@gmail.com

Siddharth Sharma

Github : @pao0318

Email : sharma.siddharthspacex21@gmail.com

Tanishq Dubey

Github : @tanishq12442

Email : tanishqdubey12442@gmail.com

Ankit Oscar Xalxo

GitHub : @ankitoscar

Email : ankitoscar911@gmail.com

Version History

  • 0.1
    • Initial Release


Built With

Share this project: