Comments (4)
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.
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.
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.
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)
- Improve performance using numba HOT 1
- this has an R version here HOT 4
- Explicitly specify "name" in MultiIndex.from_product HOT 1
- Help with the subnational data HOT 1
- Is COG equal to OG? HOT 1
- RCA calculation HOT 2
- PCI calculation. HOT 3
- ecomplexity output does not conform with atlas dataverse results using R reticulate HOT 5
- RPOP - Handling zeros in diversity / ubiquity HOT 2
- Possible mistake in the code of ecomplexity.py HOT 2
- PCI normalization using wrong mean and standard deviation. HOT 3
- Implement knn for density calculations
- Add log-supermodularity checks and warnings if non-conformant HOT 1
- Allow for custom proximity matrix HOT 1
- Install problem and some question HOT 1
- Fail to install HOT 1
- ECI correlation with diversity HOT 4
- Why are the eci computed with ecomplexity different from their given values? HOT 5
- name 'ecomplexity' is not defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-ecomplexity.