Spaces:
Running
Running
File size: 4,982 Bytes
15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 83e0fd9 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 10cab27 15f93c7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# AI-Based Diamond Price Prediction and Classification
This project utilizes **machine learning and AI techniques** to predict **diamond grading prices** (GIA-certified prices, grading prices, and bygrading prices) based on various diamond attributes. Additionally, it provides classification-based recommendations for changes in diamond parameters. The system is built using **Flask**, **scikit-learn**, and **XGBoost**, and it is deployed as a web application with a user-friendly interface.
---
## π Project Overview
### Problem Statement
Manually evaluating diamond prices and certification costs is a **time-consuming and error-prone** task. This project automates the process by leveraging AI models to analyze historical data and provide **accurate predictions and recommendations** based on diamond attributes.
### Key Features
β
**Diamond Price Prediction**: Predicts GIA, grading, and bygrading prices using AI.
β
**Parameter Change Analysis**: Identifies and suggests modifications in diamond attributes.
β
**Automated Data Processing**: Cleans and preprocesses input data for better model accuracy.
β
**Web-Based Interface**: Flask-based UI for easy file uploads and result visualization.
β
**Downloadable Reports**: Users can download CSV reports for predictions and analysis.
---
## βοΈ Tech Stack
| Component | Tools/Technologies Used |
|---------------|----------------------|
| **Backend** | Flask, scikit-learn, XGBoost, NumPy, Pandas |
| **Frontend** | HTML, CSS, Jinja Templates |
| **Database** | CSV/Excel file-based input |
| **Deployment** | Docker, Gunicorn |
| **Machine Learning** | Linear Regression, Decision Trees, Random Forest, K-Nearest Neighbors, XGBoost |
---
## π Project Workflow
### πΉ Input:
- Users upload a CSV/Excel file containing **diamond attributes** (Tag, Carat, Shape, Quality, Color, Cut, Polish, Symmetry, Fluorescence, etc.).
### πΉ Processing:
- **Prediction Models** estimate GIA prices, grading prices, and bygrading prices.
- **Classification Models** analyze changes in diamond parameters (e.g., carat, color, cut).
### πΉ Output:
- Users receive **predicted values** and **recommendations** based on AI models.
- Results are displayed in a structured table.
- Users can **download reports** as CSV files.
---
## π οΈ Setup Instructions
### 1οΈβ£ Clone the Repository
```bash
git clone https://huggingface.co/spaces/WebashalarForML/DiamRapo
cd diamond-price-prediction
```
### 2οΈβ£ Create a Virtual Environment (Optional)
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
### 3οΈβ£ Install Dependencies
```bash
pip install -r requirements.txt
```
### 4οΈβ£ Run the Application
```bash
python app.py
```
Visit `http://127.0.0.1:5000` in your browser.
---
## π¦ Running with Docker
### 1οΈβ£ Build the Docker Image
```bash
docker build -t diamond-prediction .
```
### 2οΈβ£ Run the Container
```bash
docker run -p 7860:7860 diamond-prediction
```
Now, visit `http://localhost:7860` to use the app.
---
## π API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/` | GET | Home page |
| `/predict` | POST | Uploads a CSV/Excel file and predicts diamond prices |
| `/download_pred` | GET | Downloads prediction results as CSV |
| `/download_class` | GET | Downloads classification analysis as CSV |
---
## π Project Structure
```
.
βββ app.py # Flask application
βββ templates/
β βββ index.html # Home page template
β βββ output.html # Output display template
βββ static/ # CSS and static files
βββ Model/ # Trained ML models (.joblib)
βββ Label_encoders/ # Pretrained label encoders
βββ uploads/ # Uploaded files storage
βββ data/ # Processed data files
βββ requirements.txt # Dependencies list
βββ Dockerfile # Docker setup
βββ README.md # Documentation
```
---
## π Example Use Cases
### 1οΈβ£ Predicting Diamond Prices
- Upload a **diamond dataset (CSV/Excel)**.
- The AI model predicts **GIA price, grading price, and bygrading price**.
- Download the results as a structured report.
### 2οΈβ£ Identifying Diamond Parameter Changes
- AI analyzes changes in **carat, cut, color, and other attributes**.
- Alerts users to potential modifications in the diamond properties.
---
## π Future Enhancements
- β
Improve model accuracy with deep learning.
- β
Add support for **real-time API integration** with diamond pricing databases.
- β
Extend the system to predict **market trends** using time-series forecasting.
---
## π‘ Credits
Developed by **Webashlar**, a leading IT company specializing in AI, data science, and software solutions.
Happy predicting! πβ¨
---
|