Guarding OSM from invalid or suspicious edits!
Project description
EXPERIMENTAL: UNDER DEVELOPMENT
Guarding OSM from invalid or suspicious edits, Gabbar is an alpha package of a pre-trained binary problematic/not problematic classifier that was trained on manually labelled changesets from OpenStreetMap.
https://en.wikipedia.org/wiki/Gabbar_Singh_(character)
Running tests
# Setup a virtual environment.
$ mkvirtualenv gabbar
# Install in locally editable (``-e``) mode.
$ pip install -e .
# Run the tests.
$ py.test
Publishing to PyPi
# Bump the version.
$ $EDITOR setup.py
# Bump the tag.
$ git tag <VERSION>
# Push your changes to Github.
$ git push
$ git push --tags
# Create a Source Distribution.
python setup.py sdist
# A wheel can be installed without needing to go through the "build" process.
python setup.py bdist_wheel --universal
# Optionally upload to Test PyPI if required.
$ twine upload dist/* -r testpypi
# Upload to PyPi
twine upload dist/*
Model training
# Download osm changeset dataset and split into good and problematic changeset files.
$ python training/dataprep.py
# View features of changeset used for training the model.
$ head -n5 training/problematic.prep.csv
check date,create,modify,delete
2016-12-20T19:55:46.153444+00:00,0.0,0.0,327.0
2016-12-20T20:43:03.137419+00:00,9062.0,0.0,0.0
2016-12-20T12:09:43.259591+00:00,10.0,20.0,8.0
2016-12-21T10:09:33.445841+00:00,337.0,538.0,113.0
# Run datatrain.py to train a OneClassSVM on the dataset.
$ python training/datatrain.py
training samples: 12364
[testing] good samples: 5299
[testing] problematic samples: 671
precision = 0.915625
recall = 0.442348
f1_score = 0.596514
# Find the trained model as a .pkl file.
$ ls training/gabbar.pkl
training/gabbar.pkl
Hyperlinks
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gabbar-0.2.3.tar.gz
(3.3 kB
view hashes)
Built Distribution
gabbar-0.2.3-py2.py3-none-any.whl
(120.4 kB
view hashes)
Close
Hashes for gabbar-0.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc551d4dcb556c406063705c81eb515ecc18030c5bd958005b1578e9c39dbdf8 |
|
MD5 | c192eabf5aa0343b52d1652101f3397b |
|
BLAKE2b-256 | 964258c228132b904c07e4dd26a0ac3de597d1615f31e98fcb7da7a1128e3372 |