Main
View or edit on GitHub
This page is synchronized from trase/models/brazil/soy_2017_qa/main.ipynb. Last modified on 2025-12-14 23:19 CET by Trase Admin.
Please view or edit the original file there; changes should be reflected here after a midnight build (CET time),
or manually triggering it with a GitHub action (link).
Quality assurance branches
This table presents the quality assurance decision tree branches:
| Overlap | better hub | same hub | different hub in same state | hub in different state | old unknown | new unknown |
|---|---|---|---|---|---|---|
| CNPJ-port-country | 2.1 | 1.1 | 3.1 | 4.1 | 5.1 | 6.1 |
| CNPJ-port | 2.2 | 1.2 | 3.2 | 4.2 | 5.2 | 6.2 |
| CNPJ | 2.3 | 1.3 | 3.3 | 4.3 | 5.3 | 6.3 |
| CNPJ8-port-country | - | 1.4 | 3.4 | 4.4 | - | 6.4 |
| CNPJ8-port | - | 1.5 | 3.5 | 4.5 | - | 6.5 |
| CNPJ8 | - | 1.6 | 3.6 | 4.6 | - | 6.6 |
| port-country | - | 1.7 | 3.7 | 4.7 | - | 6.7 |
| port | - | 1.8 | 3.8 | 4.8 | - | 6.8 |
from trase.tools import sps
supplychain = sps.SupplyChain("brazil/soy_2017_qa", year=2017)
supplychain.preparation()
supplychain.load()
data = supplychain.run()
# supplychain.flow_report_by_attribute("vol", ["qa_branch"], 8)
# supplychain.flow_report_by_attribute("vol", ["detailed_qa_branch"], 8)
# supplychain.flow_report_by_attribute("vol", ["agreement"], 8)
# supplychain.flow_report_by_attribute("vol", ["overlap"], 8)
supplychain.export_results()
import numpy as np
np.random.seed(0)
import seaborn as sns
sns.set_theme()
ax = sns.heatmap(data / 1000000000, cmap="YlGnBu", annot=True, square=True, cbar=False)
ax.invert_yaxis()
ax.set_xlabel("overlap (data)", fontsize=20)
ax.set_ylabel("agreement (models)", fontsize=20)
ax.set_title("volume (Mtons)", fontsize=20)