Skip to content

Commit

Permalink
Merge pull request #90 from mapbox/ignore-node-features
Browse files Browse the repository at this point in the history
Ignore features of geometry type node
  • Loading branch information
bkowshik authored Jul 10, 2017
2 parents b304270 + 4c464d7 commit 2911f66
Show file tree
Hide file tree
Showing 9 changed files with 1,320 additions and 428 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.2
0.6.3
11 changes: 11 additions & 0 deletions documentation/anomaly-detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,17 @@ Labelled good 182 1636
Predicted harmful Predicted good
Labelled harmful 23 32
Labelled good 38 361

# Filtering out node features.
- Training
Predicted harmful Predicted good
Labelled harmful 0 0
Labelled good 173 1549

- Validation
Predicted harmful Predicted good
Labelled harmful 37 16
Labelled good 36 341
```

```bash
Expand Down
3 changes: 3 additions & 0 deletions gabbar/filters/highway.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function getSamples(changeset, forTraining) {
let newVersion = feature[0];
let oldVersion = feature[1];

let featureType = featureAttributes.getGeometryType(newVersion);
if (!forTraining && (featureType === 'node')) continue;

let nameModified = featureAttributes.isNameModified(newVersion, oldVersion);
// Skipping samples where a feature's name was modified.
if (!forTraining && nameModified === 1) continue;
Expand Down
Binary file modified gabbar/trained/model.pkl
Binary file not shown.
856 changes: 429 additions & 427 deletions notebooks/anomaly_detection.ipynb

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions tests/fixtures/changesets/50167186.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"id": "4961098629",
"version": "1",
"timestamp": "2017-07-10T06:50:11Z",
"changeset": "50167186",
"uid": "1859838",
"user": "Shl-EF",
"action": "create",
"type": "node",
"tags": {
"emergency_telephone_code": "112",
"highway": "emergency_access_point",
"ref": "SON 6145"
},
"changeType": "added"
},
"geometry": {
"type": "Point",
"coordinates": [
11.0292429,
50.505238
]
}
}
]
}
56 changes: 56 additions & 0 deletions tests/fixtures/real_changesets/50167186.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"elements": [
{
"id": "4961098629",
"lat": "50.5052380",
"lon": "11.0292429",
"version": "1",
"timestamp": "2017-07-10T06:50:11Z",
"changeset": "50167186",
"uid": "1859838",
"user": "Shl-EF",
"action": "create",
"type": "node",
"tags": {
"emergency_telephone_code": "112",
"highway": "emergency_access_point",
"ref": "SON 6145"
}
}
],
"metadata": {
"id": "50167186",
"created_at": "2017-07-10T06:50:11Z",
"closed_at": "2017-07-10T06:50:11Z",
"open": "false",
"user": "Shl-EF",
"uid": "1859838",
"min_lat": "50.5052380",
"min_lon": "11.0292429",
"max_lat": "50.5052380",
"max_lon": "11.0292429",
"comments_count": "0",
"tag": [
{
"k": "comment",
"v": "Rettungspunkt"
},
{
"k": "locale",
"v": "de"
},
{
"k": "host",
"v": "https://www.openstreetmap.org/edit"
},
{
"k": "imagery_used",
"v": "Bing aerial imagery;Local GPX"
},
{
"k": "created_by",
"v": "iD 2.3.0"
}
]
}
}
Loading

0 comments on commit 2911f66

Please sign in to comment.