geocif 0.2.29__tar.gz → 0.2.31__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {geocif-0.2.29/geocif.egg-info → geocif-0.2.31}/PKG-INFO +1 -1
- {geocif-0.2.29 → geocif-0.2.31}/geocif/geocif.py +1 -1
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/feature_selection.py +19 -0
- {geocif-0.2.29 → geocif-0.2.31/geocif.egg-info}/PKG-INFO +1 -1
- {geocif-0.2.29 → geocif-0.2.31}/setup.py +1 -1
- {geocif-0.2.29 → geocif-0.2.31}/LICENSE +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/MANIFEST.in +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/README.md +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/__init__.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/agmet/__init__.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/agmet/geoagmet.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/agmet/plot.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/agmet/utils.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/analysis.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/backup/__init__.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/backup/constants.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/backup/features.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/backup/geo.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/backup/geocif.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/backup/metadata.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/backup/models.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/cei/__init__.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/cei/definitions.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/cei/indices.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/experiments.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/geocif_runner.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/indices_runner.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/indices_runner_angola.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/indices_runner_madagascar.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/indices_runner_malawi.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/indices_runner_mozambique.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/indices_runner_south_africa.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/indices_runner_zambia.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/indices_runner_zimbabwe.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/logger.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/__init__.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/correlations.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/embedding.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/feature_engineering.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/outliers.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/outlook.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/output.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/spatial_autocorrelation.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/stages.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/stats.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/trainers.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/trend.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/ml/xai.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/mm.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/__init__.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/aa.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/area.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/automl.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/download_esi.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/enso.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/eval.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/gamtest.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/gee_access.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/misc.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/play_xagg.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/reg.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/sustain.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/test_catboost.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/tmp.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/tmp2.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/tmp3.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/tmp4.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/tmp5.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/playground/wolayita_maize_mask.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/risk/__init__.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/risk/impact_assessment.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/utils.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/viz/__init__.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/viz/gt.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/viz/plot.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif/viz/tmp.py +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif.egg-info/SOURCES.txt +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif.egg-info/dependency_links.txt +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif.egg-info/not-zip-safe +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/geocif.egg-info/top_level.txt +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/requirements.txt +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/setup.cfg +0 -0
- {geocif-0.2.29 → geocif-0.2.31}/tests/test_geocif.py +0 -0
@@ -7,6 +7,7 @@ from collections import Counter
|
|
7
7
|
from pathlib import Path
|
8
8
|
import matplotlib.pyplot as plt
|
9
9
|
import pandas as pd
|
10
|
+
import seaborn as sns
|
10
11
|
|
11
12
|
|
12
13
|
def are_all_features_non_eo(features):
|
@@ -79,6 +80,8 @@ def select_features(
|
|
79
80
|
# --- multi-method ensemble -------------------------------
|
80
81
|
if method == "multi":
|
81
82
|
counter = Counter()
|
83
|
+
selections = {}
|
84
|
+
|
82
85
|
models = ["BorutaPy", "mrmr"]
|
83
86
|
# run three selectors and count feature picks
|
84
87
|
for sub_m in models:
|
@@ -89,6 +92,7 @@ def select_features(
|
|
89
92
|
threshold_nan=threshold_nan,
|
90
93
|
threshold_unique=threshold_unique
|
91
94
|
)
|
95
|
+
selections[sub_m] = set(feats)
|
92
96
|
counter.update(feats)
|
93
97
|
|
94
98
|
# union of all features
|
@@ -109,6 +113,21 @@ def select_features(
|
|
109
113
|
fig.savefig(dir_output / f"feature_selection_frequency_{region}.png", dpi=300)
|
110
114
|
plt.close(fig)
|
111
115
|
|
116
|
+
# build DataFrame: rows=features, cols=methods, 1 if selected
|
117
|
+
sel_df = pd.DataFrame(
|
118
|
+
{m: [1 if f in selections[m] else 0 for f in combined] for m in models},
|
119
|
+
index=combined
|
120
|
+
)
|
121
|
+
|
122
|
+
fig2, ax2 = plt.subplots(figsize=(10, max(6, len(combined) * 0.3)))
|
123
|
+
sns.heatmap(sel_df, annot=True, cbar=False, linewidths=0.5, ax=ax2)
|
124
|
+
ax2.set_xlabel("Method")
|
125
|
+
ax2.set_ylabel("Feature")
|
126
|
+
ax2.set_title("Which features each method selected")
|
127
|
+
plt.tight_layout()
|
128
|
+
fig2.savefig(dir_output / f"feature_selection/feature_selection_methods_{region}.png", dpi=300)
|
129
|
+
plt.close(fig2)
|
130
|
+
|
112
131
|
return None, X_out, combined
|
113
132
|
|
114
133
|
# define forest for methods that need it
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|