diff --git a/docs/.DS_Store b/docs/.DS_Store index a90f1c7..7744ace 100644 Binary files a/docs/.DS_Store and b/docs/.DS_Store differ diff --git a/docs/A_brief_introduction/A_brief_introduction.md b/docs/A_brief_introduction/A_brief_introduction.md index 030b9a1..06347df 100644 --- a/docs/A_brief_introduction/A_brief_introduction.md +++ b/docs/A_brief_introduction/A_brief_introduction.md @@ -34,7 +34,7 @@ In the [demo](https://chenyangkang.github.io/stemflow/Examples/01.AdaSTEM_demo.h In the first case, the classifier and regressor "talk" to each other in each separate stixel (hereafter, "hurdle in Ada"); In the second case, the classifiers and regressors form two "unions" separately, and these two unions only "talk" to each other at the final combination, instead of in each stixel (hereafter, "Ada in hurdle"). In [Johnston (2015)](https://esajournals.onlinelibrary.wiley.com/doi/full/10.1890/14-1826.1) the first method was used. See section "[Hurdle in AdaSTEM or AdaSTEM in hurdle?](https://chenyangkang.github.io/stemflow/Examples/05.Hurdle_in_ada_or_ada_in_hurdle.html)" for further comparisons. ## Choose the gird size -User can define the size of the stixels (spatial temporal grids) in terms of space and time. Larger stixel promotes generalizability but loses precision in fine resolution; Smaller stixel may have better predictability in the exact area but reduced ability of extrapolation for points outside the stixel. See section [Optimizing stixel size](https://chenyangkang.github.io/stemflow/Examples/07.Optimizing_stixel_size.html) for discussion about selecting gridding parameters. +User can define the size of the stixels (spatial temporal grids) in terms of space and time. Larger stixel promotes generalizability but loses precision in fine resolution; Smaller stixel may have better predictability in the exact area but reduced ability of extrapolation for points outside the stixel. See section [Optimizing stixel size](https://chenyangkang.github.io/stemflow/Examples/07.Optimizing_stixel_size.html) for discussion about selecting gridding parameters and [Tips for spatiotemporal indexing](https://chenyangkang.github.io/stemflow/Tips/Tips_for_spatiotemporal_indexing.html). ## A simple demo In the demo, we first split the training data using temporal sliding windows with a size of 50 day of year (DOY) and step of 20 DOY (`temporal_start = 1`, `temporal_end=366`, `temporal_step=20`, `temporal_bin_interval=50`). For each temporal slice, a spatial gridding is applied, where we force the stixel to be split into smaller 1/4 pieces if the edge is larger than 25 units (measured in longitude and latitude, `grid_len_upper_threshold=25`), and stop splitting to prevent the edge length being chunked below 5 units (`grid_len_lower_threshold=5`) or containing less than 50 checklists (`points_lower_threshold=50`). Model fitting is run using 1 core (`njobs=1`). diff --git a/docs/Examples/04.SphereAdaSTEM_demo.ipynb b/docs/Examples/04.SphereAdaSTEM_demo.ipynb index d27157a..0f83f6f 100644 --- a/docs/Examples/04.SphereAdaSTEM_demo.ipynb +++ b/docs/Examples/04.SphereAdaSTEM_demo.ipynb @@ -46406,6 +46406,20 @@ "model.gridding_plot" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "![Sphere Gridding](https://chenyangkang.github.io/stemflow/assets/Sphere_gridding.png)\n", + "\n", + "Here for an interactive plot [Interactive spherical gridding plot](https://chenyangkang.github.io/stemflow/assets/Sphere_gridding.html)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, { "cell_type": "code", "execution_count": 12, diff --git a/docs/Tips/Tips_for_spatiotemporal_indexing.md b/docs/Tips/Tips_for_spatiotemporal_indexing.md index 9647582..f376a52 100644 --- a/docs/Tips/Tips_for_spatiotemporal_indexing.md +++ b/docs/Tips/Tips_for_spatiotemporal_indexing.md @@ -207,7 +207,7 @@ model = SphereAdaSTEMRegressor( See [SphereAdaSTEM demo](https://chenyangkang.github.io/stemflow/Examples/04.SphereAdaSTEM_demo.html) and [Interactive spherical gridding plot](https://chenyangkang.github.io/stemflow/assets/Sphere_gridding.html). -![Sphere Gridding](https://chenyangkang.github.io/stemflow/assets/Sphere_gridding.png) +![Sphere Gridding](https://chenyangkang.github.io/stemflow/assets/Sphere_gridding.png){: style="display: block; margin: auto; width: 50%;"} ----- ## References: diff --git a/docs/assets/Untitled-1.psd b/docs/assets/Untitled-1.psd index ebb1391..5b1d5b1 100644 Binary files a/docs/assets/Untitled-1.psd and b/docs/assets/Untitled-1.psd differ diff --git a/docs/assets/logo_with_words.png b/docs/assets/logo_with_words.png index 4fce165..b60d217 100644 Binary files a/docs/assets/logo_with_words.png and b/docs/assets/logo_with_words.png differ diff --git a/docs/index.md b/docs/index.md index e62409c..2f42851 100644 --- a/docs/index.md +++ b/docs/index.md @@ -186,7 +186,7 @@ Here, each color shows an ensemble generated during model fitting. In each of th If you use `SphereAdaSTEM` module, the gridding plot is a `plotly` generated interactive object by default: -![Sphere Gridding](https://chenyangkang.github.io/stemflow/assets/Sphere_gridding.png) +![Sphere Gridding](https://chenyangkang.github.io/stemflow/assets/Sphere_gridding.png){: style="display: block; margin: auto; width: 50%;"} See [SphereAdaSTEM demo](https://chenyangkang.github.io/stemflow/Examples/04.SphereAdaSTEM_demo.html) and [Interactive spherical gridding plot](https://chenyangkang.github.io/stemflow/assets/Sphere_gridding.html). diff --git a/stemflow/model/SphereAdaSTEM.py b/stemflow/model/SphereAdaSTEM.py index 405ccf3..89eb9e3 100644 --- a/stemflow/model/SphereAdaSTEM.py +++ b/stemflow/model/SphereAdaSTEM.py @@ -520,8 +520,7 @@ def __init__( plot_empty, ) - def predict(self, *args, **kwargs): - return AdaSTEMClassifier().predict(*args, **kwargs) + self.predict = MethodType(AdaSTEMClassifier.predict, self) class SphereAdaSTEMRegressor(SphereAdaSTEM): diff --git a/stemflow/utils/sphere_quadtree.py b/stemflow/utils/sphere_quadtree.py index 7dba503..ee4d2dd 100644 --- a/stemflow/utils/sphere_quadtree.py +++ b/stemflow/utils/sphere_quadtree.py @@ -148,9 +148,9 @@ def get_ensemble_sphere_quadtree( x, y, z = lonlat_cartesian_3D_transformer.transform( sub_data["longitude"], sub_data["latitude"], radius=radius ) - sub_data["x_3D"] = x - sub_data["y_3D"] = y - sub_data["z_3D"] = z + sub_data.loc[:, "x_3D"] = x + sub_data.loc[:, "y_3D"] = y + sub_data.loc[:, "z_3D"] = z QT_obj = Sphere_QTree( grid_len_upper_threshold=grid_len_upper_threshold,