Giter VIP home page Giter VIP logo

Comments (4)

shreyasgm avatar shreyasgm commented on June 19, 2024

Thanks for the comment. The sample code uses only 2 digit HS codes (just for syntax demonstration, since the 4 digit dataset takes much longer to download), which is too coarse to generate reasonable ECI and PCI values. You should get results much closer to the Atlas if you use 4 digit HS codes instead:

from ecomplexity import ecomplexity
from ecomplexity import proximity

# Import trade data from CID Atlas
data_url = "https://intl-atlas-downloads.s3.amazonaws.com/country_hsproduct4digit_year.csv.zip"
data = pd.read_csv(data_url, compression="zip", low_memory=False)
data = data[['year','location_code','hs_product_code','export_value']]

# Calculate complexity
trade_cols = {'time':'year', 'loc':'location_code', 'prod':'hs_product_code', 'val':'export_value'}
cdata = ecomplexity(data, trade_cols)

from py-ecomplexity.

tomleung1996 avatar tomleung1996 commented on June 19, 2024

Thank you for your quick response!

I have tried the 4 digit data but the results were still confusing. Take the 2016 ECIs as an example, UMI (United States Minor Outlying Islands), WLF (Wallis and Futuna), NIU (Niue), and many other small countries still possess an ECI much higher than USA, China, etc, even after data filtering (Top-100).

Is this normal?

Thanks again.

from py-ecomplexity.

shreyasgm avatar shreyasgm commented on June 19, 2024

Ah, I see. We do have an underlying data cleaning process that removes certain products and countries (including very small countries), which is why the countries you mentioned don't feature on the Atlas rankings page that you linked to. There's a little bit more detail on the data cleaning here. If you want the full cleaning process, I'd suggest you reach out to the authors of the cleaning process (Sebastian Bustos / Muhammed Yildrim), who might be able to send you a copy of the process we use to clean UN COMTRADE data before using it for complexity calculations.

from py-ecomplexity.

tomleung1996 avatar tomleung1996 commented on June 19, 2024

Thank you. I thought this algorithm should be more robust to the data. Is it possible to share a one-year copy of the processed data? So I can get a sense of the data cleaning process I should design for my task.

from py-ecomplexity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.