You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge branch 'master' into test_python333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333.11
"In general, price of a house is determined under many factors and the location always plays a paramount role in making value of the property. In this notebook, we will discover how geo-related aspects affect housing price in the USA. We will consider a house based on the information provided in ***an existing dataset*** with some addtional spatial attributes extracted from its location using xarray-spatial ***(and probably some elevation dataset, and census-parquet as well?)***.\n",
25
+
"\n",
26
+
"Existing features:\n",
27
+
"- ...\n",
28
+
"\n",
29
+
"New features:\n",
30
+
"- ***Slope?*** (from an elevation dataset)\n",
31
+
"- ***Population density, ...?*** (from Census if none available in the existing features)\n",
32
+
"- Distance to nearest hospital (or grocery store / university / pharmacy)\n",
33
+
"\n",
34
+
"We'll first build a machine learning model and train it with all existing features. For each newly added feature, we'll retrain it and compare the results to find out which features help enrich the model."
"Here the zones are defined by line segments, but they can be any spatial pattern or, more specifically, any region computable as a Datashader aggregate."
193
194
]
195
+
},
196
+
{
197
+
"cell_type": "markdown",
198
+
"metadata": {},
199
+
"source": [
200
+
"## Zonal crosstab\n",
201
+
"\n",
202
+
"Zonal crosstab function can be used when we want to calculate cross-tabulated (categorical stats) areas between two datasets. As an example, assume we have gender data (male/female), and we want to see how all the gender groups distributed over all the zones defined above.\n",
203
+
"\n",
204
+
"First, let's create a mock dataset for gender: 1 for male, and 2 for female. "
205
+
]
206
+
},
207
+
{
208
+
"cell_type": "code",
209
+
"execution_count": null,
210
+
"metadata": {},
211
+
"outputs": [],
212
+
"source": [
213
+
"# define a mask where 0s are water, and 1s are land areas\n",
214
+
"mask = terrain.data.astype(bool).astype(int)\n",
215
+
"\n",
216
+
"# gender data where 0s are nodata, 1s are male, and 2s are female\n",
217
+
"# assume that the population only takes 10% overall, and the probability of male and female are equal.\n",
0 commit comments