[2022 KPMG Ideathon Challenge] Pygmalion
Won 3rd place
First of all, features of product are extracted from the company website and they are converted to JSON form. In this repository, it only cares about smartphones which we selected as our sample type.
Converted JSON file is passed to our API Gateway which will return carbon emission prediction. It goes to our server which contains our AI module. AI module consists of certain models which we pre-trained through some known smartphone data. It responses the carbon emission prediction and API returns such value.
To explain more about our AI module, it is mainly controlled by phone-api.py
which handles API communication with models. phone-api.py
first scales the given data with pre-trained scaler and then calls three AI-models: production1.pkl
, transport2.pkl
, use3.pkl
. These are the models we have trained carbon emission of production, transport, use procedure respectively through some known data of Apple, Huawei, Google smartphones. Finally, it returns those three carbon emission predictions.
[JSON] http://20.194.102.116:5000/predict/data
You can get the carbon emission prediction by giving JSON file of information of phones to /predict/data. JSON file should be the form like below.
[{
"product": "GalaxyS22-256GB",
"display(ppi)": 425.0,
"battery(mAh)": 3700.0,
"mass(g)": 167.0,
"storage(GB)": 256.0,
"release(yr)": 2022,
"price(USD)": 799.99,
"brand": "Samsung"
}]
[Single Query]
Returns...
{"predictions":"[{\"product\":\"GalaxyS22-256GB\",\"production\":71.8194846038,\"transport\":2.0652348078,\"use\":9.7403658281}]"}
You can also put a single query after /predict/single to receive carbon emission prediction. The query should include information of product, display, battery, mass, storage, release, price for prediction.
$ pip install numpy
$ pip install scipy
$ pip install scikit-learn
$ pip install pandas
$ pip install joblib
$ pip install requests
$ pip install gunicorn
$ pip install dill
$ pip install Flask
- Clone this repository.
- Satisfy every requirements.
- Go to local repository folder, run:
$ cd API
$ nohup gunicorn --bind 0.0.0.0:5000 phone-api:app &
The main service of Usual Shopping mall was Comparing price
We can go into Carbon Filter mode, which Pymalion Serves by clicking 'Carbon Filter' button.
With our service, Customers can go into high-involvement shopping without considering price.
https://alsdyd98.github.io/2022_kpmg_Pygmalion/P-market/index.html
phone-api.py
: Python scripts that works for API communication & model implicationscaler.pkl
: Model of scaling given dataproduction1.pkl
: Prediction model of carbon emmision on production processtransport2.pkl
: Prediction model of carbon emmision on transport processuse3.pkl
: Prediction model of carbon emmision on use process