This API provides endpoints to manage and predict mobile phone prices based on their specifications. It allows you to create and retrieve mobile phone records, as well as predict price ranges for existing devices.
This API provides endpoints to manage and predict mobile phone prices based on their specifications. It allows you to create and retrieve mobile phone records, as well as predict price ranges for existing devices.
- Description: This folder stores the saved algorithms used for price prediction. It contains the trained models that can be utilized for making predictions based on mobile phone specifications.
- Description: This is the base Django project folder. It contains the core settings and configurations necessary for running the Django application, including middleware, URL routing, and installed apps.
- Description: This folder contains the Django app specifically designed for mobile phone price prediction. It includes the models, views, serializers, and other components necessary for handling mobile phone data and predictions.
http://your-domain.com/ or http://localhost:8000/
- URL:
/api/devices/ - Methods: GET, POST
- Description: Get a list of all mobile phones or create a new mobile phone entry
[
{
"id": 1,
"battery_power": 1000,
"blue": 1,
"clock_speed": 2.2,
...
"price_range": 3
}
]{
"battery_power": 1000,
"blue": 1,
"clock_speed": 2.2,
"dual_sim": 1,
"fc": 8,
"four_g": 1,
"int_memory": 64,
"m_dep": 0.7,
"mobile_wt": 180,
"n_cores": 8,
"pc": 12,
"px_height": 1920,
"px_width": 1080,
"ram": 4096,
"sc_h": 15.5,
"sc_w": 7.5,
"talk_time": 20,
"three_g": 1,
"touch_screen": 1,
"wifi": 1,
"price_range": null
}- URL:
/api/devices/<device_id>/ - Methods: GET
- Description: Get individual mobile phone record
- URL:
/api/predict/<device_id>/ - Method: POST
- Description: predict the price, and save the result in the device entity
| Field | Type | Description |
|---|---|---|
| battery_power | Integer | Total energy a battery can store in mAh |
| blue | Integer | Has Bluetooth or not (0/1) |
| clock_speed | Float | Speed at which microprocessor executes |
| dual_sim | Integer | Has dual sim support or not (0/1) |
| fc | Integer | Front Camera megapixels |
| four_g | Integer | Has 4G or not (0/1) |
| int_memory | Integer | Internal Memory in Gigabytes |
| m_dep | Float | Mobile Depth in cm |
| mobile_wt | Integer | Weight of mobile phone |
| n_cores | Integer | Number of cores of processor |
| pc | Integer | Primary Camera megapixels |
| px_height | Integer | Pixel Resolution Height |
| px_width | Integer | Pixel Resolution Width |
| ram | Integer | Random Access Memory in Megabytes |
| sc_h | Float | Screen Height of mobile in cm |
| sc_w | Float | Screen Width of mobile in cm |
| talk_time | Integer | Longest time that battery charge will last |
| three_g | Integer | Has 3G or not (0/1) |
| touch_screen | Integer | Has touch screen or not (0/1) |
| wifi | Integer | Has wifi or not (0/1) |
| price_range | Integer | Price range category (0-3) |
- 0: Low Cost
- 1: Medium Cost
- 2: High Cost
- 3: Very High Cost
The API includes an admin interface with the following features:
- Import/Export functionality for bulk data management
- List display showing ID, price range, battery power, RAM, and internal memory
- Filtering by price range, 4G, 3G, WiFi, and touch screen
- Search functionality by ID
- url endpoint: admin/
- Username: admin
- Password: admin
- All boolean fields (blue, dual_sim, four_g, three_g, touch_screen, wifi) are stored as integers (0/1)
- The price_range field is nullable and can be left blank during creation
- The API uses Django REST Framework's ModelSerializer for data validation and serialization