Skip to content

dqniellew1/NFT_pricing_model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFT pricing model for Pudgy Penguins NFT

About

NFT pricing model.

Getting Started

  1. Install Python and start a virtual environment
  2. Install required packages
pip install -r requirement.txt
  1. Run data.py to get data for model - calls from opensea api, process data and saves into data.csv
python3 data.py
  1. Run predict.py to get predictions - saves into preds.csv
python3 predict.py 
  1. Alternatively run notebooks in colab
  • Get data.csv from repository to load into colab notebooks Penguins_data_&_model.ipynb & Penguins_analysis.ipynb

File Structure

  • NFT pricing model
    • app.py: Flask API/web application
    • data.py: function to get and process the data
    • fit.py: initiates a new model, trains the model, and saves as joblib model
    • predict.py: takes in data and returns predictions
    • requirements.txt: list of packages that the app will import
    • lib
      • data: directory that contains the data and prediction files
      • models: directory that contains the pickled model files

Testing the API

  1. Run the Flask API locally for testing. Go to directory with app.py.
python app.py
  1. In a new terminal window, use HTTPie to make a GET request at the URL of the API.
http http://127.0.0.1:5000/api nft_id==1 
  1. Example of successful output.
HTTP/1.0 200 OK
Content-Length: 203
Content-Type: application/json
Date: Thu, 19 Aug 2021 05:48:52 GMT
Server: Werkzeug/1.0.1 Python/3.7.7
{
    "image_link": "https://api.pudgypenguins.io/penguin/image/1",
    "nft_id": 1,
    "opensea-link": "https://opensea.io/assets/0xbd3531da5cf5857e7cfaa92426877b022e612cf8/1",
    "prediction": 3.4
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published