This project uses Python with Dask to efficiently manipulate and analyze a comprehensive dataset on global trade. Our objectives include deriving descriptive statistics, identifying trade patterns through unsupervised learning, and predicting trade flows using machine learning techniques.
The project kicks off by identifying countries with the most and least trading partners, utilizing Dask's data frame capabilities for efficient computation. Further analysis extends into understanding overall trade volume and identifying sectors of highest value in the trade dataset.
- Calculated the number of unique trading partners for each country.
- Identified the top 10 and bottom 10 countries based on the number of trading partners.
- Merged product descriptions with trade data to categorize trade volumes.
- Highlighted sectors of economic significance, including petroleum, pharmaceuticals, metals, communications, and automobiles.
Using functions such as group by, trade data are explored
Employing unsupervised learning techniques, we aim to uncover latent patterns in the global trade data. The approach involves normalizing data and applying K-means clustering to reveal clusters of countries based on their trading behaviors.
- Applied K-means clustering to distinguish groups with similar export/import values and sectors.
- Utilized PCA for dimensionality reduction, aiding in visualization and analysis.
![image](https://private-user-images.githubusercontent.com/94425924/328533153-308145d3-840c-4abd-b788-5a4b3ef6ab73.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MDQ1NjAsIm5iZiI6MTcyMzkwNDI2MCwicGF0aCI6Ii85NDQyNTkyNC8zMjg1MzMxNTMtMzA4MTQ1ZDMtODQwYy00YWJkLWI3ODgtNWE0YjNlZjZhYjczLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDE0MTc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU3ZTFiMTcwYjIzOWM5NmFjNGRhYmU2M2I5OGM4ZTE1ZDljMGRjMmE4ZmE2ZmFjYWU3ZTJmYTQ4MTMxYzk5NTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.M4m7sTn_pr9YMDGIuxCCIGXOObc-XsxNhd9xwXNXA0g)
![image](https://private-user-images.githubusercontent.com/94425924/328534241-90c8e093-8368-4076-884a-f2248f832c05.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MDQ1NjAsIm5iZiI6MTcyMzkwNDI2MCwicGF0aCI6Ii85NDQyNTkyNC8zMjg1MzQyNDEtOTBjOGUwOTMtODM2OC00MDc2LTg4NGEtZjIyNDhmODMyYzA1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDE0MTc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY2MWQxZGJhZDZjNDFjYTEzNTE4ZjMwYzdlYzA2ODM1MjZhNzc0ZTUxZjc4YmUzZGY2YWI5YzhhMzc0MjgyYzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.E11JyoOMiBEYRP0TRo_cG6oBOiyqmUfBGBKDDcsYne4)
A machine learning model predicts export quantities based on several features including distance, GDP, and specific sectors. Feature engineering and hyperparameter tuning are conducted to enhance model performance.
- Split the dataset into training and testing sets.
- Utilized RandomForestRegressor for predictions.
- Evaluated the model using metrics such as MAE, MSE, and R^2 scores.
- Predicted export quantities for unseen country-sector pairs.
- Discussed the implications and limitations of using machine learning in trade flow predictions.
Exploring the impact of distance on exporting commodities, focusing on transportation costs and the nature of the goods. This section theorizes how distance influences trade patterns and proposes an analytical framework for further investigation.
- Outlined the necessity of export data, distance metrics, and transportation cost information.
- Theorized the relationship between transportation costs, the nature of goods, and distance.
- Economically, the impact of distance on exporting commodities is related to transportation costs and the nature of the goods being traded.
- Transportation Costs: The farther a commodity needs to travel to reach its market, the higher the transportation costs. The heavier a commodity is, the higher the cost.
- Nature of Goods: Different commodities have different sensitivities to distance.
- Perishable items like fruits and vegetables suffer more from long distances due to spoilage risks.
- On the other hand, high-value goods like electronics might be less affected by distance because transportation costs form a smaller part of their overall value.
- Data Needed:
- Export Data: Detailed information on what each country exports and to where.
- Distance Data: Distances between exporting countries and major trading partners.
- Transportation Costs Data: Information on shipping costs, including rates and modes of transport.
- Presented a structured approach for analyzing the impact of distance on trade patterns.
- Suggested comparative studies, regression analysis, and detailed sector-specific case studies.
- Compare Distances: Calculate average distances for each commodity sector to different export markets.
- Cost Analysis: Analyze how transportation costs vary across sectors and how they relate to distance. (Regression analysis)
- Case Studies: Look at specific examples within sectors to understand how distance impacts trade.