geocif 0.2.38__tar.gz → 0.2.40__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.38/geocif.egg-info → geocif-0.2.40}/PKG-INFO +1 -1
- {geocif-0.2.38 → geocif-0.2.40}/geocif/geocif.py +3 -3
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/trainers.py +7 -2
- {geocif-0.2.38 → geocif-0.2.40/geocif.egg-info}/PKG-INFO +1 -1
- {geocif-0.2.38 → geocif-0.2.40}/setup.py +1 -1
- {geocif-0.2.38 → geocif-0.2.40}/LICENSE +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/MANIFEST.in +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/README.md +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/__init__.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/agmet/__init__.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/agmet/geoagmet.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/agmet/plot.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/agmet/utils.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/analysis.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/backup/__init__.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/backup/constants.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/backup/features.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/backup/geo.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/backup/geocif.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/backup/metadata.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/backup/models.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/cei/__init__.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/cei/definitions.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/cei/indices.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/experiments.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/geocif_runner.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/indices_runner.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/indices_runner_angola.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/indices_runner_madagascar.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/indices_runner_malawi.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/indices_runner_mozambique.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/indices_runner_south_africa.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/indices_runner_zambia.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/indices_runner_zimbabwe.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/logger.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/__init__.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/correlations.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/embedding.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/feature_engineering.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/feature_selection.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/outliers.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/outlook.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/output.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/spatial_autocorrelation.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/stages.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/stats.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/trend.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/ml/xai.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/mm.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/__init__.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/aa.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/area.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/automl.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/download_esi.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/enso.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/eval.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/gamtest.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/gee_access.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/misc.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/play_xagg.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/reg.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/sustain.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/test_catboost.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/tmp.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/tmp2.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/tmp3.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/tmp4.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/tmp5.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/wolayita.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/wolayita_maize_mask.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/wolayita_v2.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/playground/wolayita_v3.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/risk/__init__.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/risk/impact_assessment.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/utils.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/viz/__init__.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/viz/gt.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/viz/plot.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/viz/tmp.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif/viz/viz_ml.py +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif.egg-info/SOURCES.txt +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif.egg-info/dependency_links.txt +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif.egg-info/not-zip-safe +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/geocif.egg-info/top_level.txt +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/requirements.txt +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/setup.cfg +0 -0
- {geocif-0.2.38 → geocif-0.2.40}/tests/test_geocif.py +0 -0
@@ -328,6 +328,7 @@ class Geocif:
|
|
328
328
|
elif self.model_name == "linear":
|
329
329
|
self.model.fit(X_train_scaled, self.y_train)
|
330
330
|
elif self.model_name == "gam":
|
331
|
+
breakpoint()
|
331
332
|
self.model.fit(X_train_scaled.values, self.y_train.values)
|
332
333
|
self.best_hyperparams = {}
|
333
334
|
elif self.model_name in ["cubist"]:
|
@@ -786,7 +787,7 @@ class Geocif:
|
|
786
787
|
""" Train, Predict, Explain and Store results for each region """
|
787
788
|
pbar = tqdm(self.df_train["Region_ID"].unique(), leave=False)
|
788
789
|
for idx, region in enumerate(pbar):
|
789
|
-
if self.model_name in ["linear"
|
790
|
+
if self.model_name in ["linear"]:
|
790
791
|
self.create_feature_names(stages, dict_best_cei[region][0:3].tolist())
|
791
792
|
elif self.model_name in ["cumulative_1", "cumulative_2", "cumulative_3"]:
|
792
793
|
self.create_feature_names(stages, {})
|
@@ -1271,8 +1272,7 @@ class Geocif:
|
|
1271
1272
|
try:
|
1272
1273
|
self.loop_ml(stage, dict_selected_features, dict_best_cei)
|
1273
1274
|
except Exception as e:
|
1274
|
-
|
1275
|
-
pass
|
1275
|
+
self.logger.error(e)
|
1276
1276
|
wandb.finish()
|
1277
1277
|
|
1278
1278
|
def setup(self, forecast_season, model):
|
@@ -351,9 +351,14 @@ def auto_train(
|
|
351
351
|
"cumulative_3": s(0) + s(1) + s(2) + te(0, 1) + te(0, 2) + te(1, 2) + f(3),
|
352
352
|
}
|
353
353
|
|
354
|
-
|
355
|
-
|
354
|
+
# Fill nans with medians
|
355
|
+
for col in X_train.columns:
|
356
|
+
if X_train[col].isnull().any():
|
357
|
+
median = X_train[col].median()
|
358
|
+
X_train[col].fillna(median, inplace=True)
|
356
359
|
|
360
|
+
formula = gam_formulas.get(model_name, gam_cls(n_splines=25, spline_order=3))
|
361
|
+
model = gam_cls(n_splines=25, spline_order=3).gridsearch(X_train, y_train.values, lam=np.logspace(-3, 3, 11)) if model_name.startswith("gam") else formula
|
357
362
|
elif model_name == "geospaNN":
|
358
363
|
import torch
|
359
364
|
import geospaNN
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|