Embedder
GeoVex Embedder.
This module contains embedder from GeoVex paper[1].
References
GeoVexEmbedder(
target_features,
batch_size=32,
neighbourhood_radius=4,
convolutional_layers=2,
embedding_size=32,
convolutional_layer_size=256,
)
¶
GeoVexEmbedder(
target_features,
batch_size=32,
neighbourhood_radius=4,
convolutional_layers=2,
embedding_size=32,
convolutional_layer_size=256,
)
Bases: CountEmbedder
GeoVex Embedder.
PARAMETER | DESCRIPTION |
---|---|
target_features |
The features
that are to be used in the embedding. Should be in "flat" format,
i.e. "
TYPE:
|
batch_size |
Batch size. Defaults to 32.
TYPE:
|
convolutional_layers |
Number of convolutional layers. Defaults to 2.
TYPE:
|
neighbourhood_radius |
Radius of the neighbourhood. Defaults to 4.
TYPE:
|
embedding_size |
Size of the embedding. Defaults to 32.
TYPE:
|
convolutional_layer_size |
Size of the first convolutional layer.
TYPE:
|
Source code in srai/embedders/geovex/embedder.py
invalid_cells: list[str]
property
¶
List of invalid h3s.
¶
Create region embeddings.
PARAMETER | DESCRIPTION |
---|---|
regions_gdf |
Region indexes and geometries.
TYPE:
|
features_gdf |
Feature indexes, geometries and feature values.
TYPE:
|
joint_gdf |
Joiner result with region-feature multi-index.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame
|
pd.DataFrame: Region embeddings. |
Source code in srai/embedders/geovex/embedder.py
fit(
regions_gdf,
features_gdf,
joint_gdf,
neighbourhood,
learning_rate=0.001,
trainer_kwargs=None,
)
¶
fit(
regions_gdf,
features_gdf,
joint_gdf,
neighbourhood,
learning_rate=0.001,
trainer_kwargs=None,
)
Fit the model to the data.
PARAMETER | DESCRIPTION |
---|---|
regions_gdf |
Region indexes and geometries.
TYPE:
|
features_gdf |
Feature indexes, geometries and feature values.
TYPE:
|
joint_gdf |
Joiner result with region-feature multi-index.
TYPE:
|
neighbourhood |
The neighbourhood to use. Should be intialized with the same regions.
TYPE:
|
learning_rate |
Learning rate. Defaults to 0.001.
TYPE:
|
trainer_kwargs |
Trainer kwargs. This is where the number of epochs can be set. Defaults to None.
TYPE:
|
Source code in srai/embedders/geovex/embedder.py
fit_transform(
regions_gdf,
features_gdf,
joint_gdf,
neighbourhood,
learning_rate=0.001,
trainer_kwargs=None,
)
¶
fit_transform(
regions_gdf,
features_gdf,
joint_gdf,
neighbourhood,
learning_rate=0.001,
trainer_kwargs=None,
)
Fit the model to the data and create region embeddings.
PARAMETER | DESCRIPTION |
---|---|
regions_gdf |
Region indexes and geometries.
TYPE:
|
features_gdf |
Feature indexes, geometries and feature values.
TYPE:
|
joint_gdf |
Joiner result with region-feature multi-index.
TYPE:
|
neighbourhood |
The neighbourhood to use. Should be intialized with the same regions.
TYPE:
|
negative_sample_k_distance |
Distance of negative samples. Defaults to 2.
TYPE:
|
learning_rate |
Learning rate. Defaults to 0.001.
TYPE:
|
trainer_kwargs |
Trainer kwargs. This is where the number of epochs can be set. Defaults to None.
TYPE:
|
Source code in srai/embedders/geovex/embedder.py
¶
Save the model to a directory.
PARAMETER | DESCRIPTION |
---|---|
path |
Path to the directory.
TYPE:
|
Source code in srai/embedders/geovex/embedder.py
¶
classmethod
Load the model from a directory.
PARAMETER | DESCRIPTION |
---|---|
path |
Path to the directory.
TYPE:
|
model_module |
Model class.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
GeoVexEmbedder
|
GeoVexEmbedder object.
TYPE:
|