thinkingmachines / geomancer

Automated feature engineering for geospatial data
MIT License
216 stars 16 forks source link

Add SpellBook #41

Closed ljvmiranda921 closed 5 years ago

ljvmiranda921 commented 5 years ago

Usage ideas:

from geomancer import SpellBook

# When you want to register spells
my_spellbook = SpellBook([
  DistanceToNearest("embassy", within=10000, source_table="tm-geospatial.ph_osm.pois"), # From BQ
  DistanceToNearest("hospital", within=5000, source_table="pois"), # From Spatialite
])

# You can then do multiple casts
my_features = my_spellbook.cast(df, host=[bigquery.Client(), "tests/data/source.sqlite"])

# Saving the Spellbook
my_spellbook.author = "Lj Miranda" # optional 
my_spellbook.description = "Some cool features for other stuff" # optional
my_spellbook.to_json("path/to/my/own/features.json")

Some potential challenges:

Some preliminary tasks: