Skip to content

Commit

Permalink
Update logging and model (#58)
Browse files Browse the repository at this point in the history
## Describe your changes
Updated the level of various logging messages and the XGBoost model.

## Checklist before requesting a review
- [x] The code runs successfully.

```commandline
Accuracy Score: 0.7158848614072495
Precision Score: 0.8911951791094744
Recall Score: 0.7759801778166449
```
  • Loading branch information
michplunkett authored Jun 26, 2024
1 parent 75180c4 commit 626042c
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 344 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [ main ]

jobs:
Test:
test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
10 changes: 5 additions & 5 deletions incident_scraper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def correct_location(nbd_client: GoogleNBD) -> None:
corrected_locations += 1
updated_incidents.append(i)
else:
logging.error(
logging.debug(
"This incident failed to get a valid location with the "
f"Geocoder: {i}"
)
Expand Down Expand Up @@ -261,7 +261,7 @@ def parse_and_save_records(

if len(i.keys()) != 6:
void_malformed_incidents.append(i)
logging.error(
logging.debug(
f"This incident has an insufficient number of keys: {i}"
)
continue
Expand All @@ -286,7 +286,7 @@ def parse_and_save_records(

if not formatted_reported_value:
void_malformed_incidents.append(i)
logging.error(f"This incident has a malformed date: {i}")
logging.debug(f"This incident has a malformed date: {i}")
continue

i[INCIDENT_KEY_TYPE] = Lemmatizer.process(i[INCIDENT_KEY_TYPE])
Expand Down Expand Up @@ -330,13 +330,13 @@ def parse_and_save_records(
continue
else:
geocode_error_incidents.append(i)
logging.error(
logging.debug(
"This incident failed to get a valid location with the "
f"Geocoder: {i}"
)

geocode_error_incidents.append(i)
logging.error(
logging.debug(
"This incident failed to get a location with the GoogleMaps' "
f"Geocoder: {i}"
)
Expand Down
Binary file modified incident_scraper/data/xgb_prediction_model.pkl
Binary file not shown.
Binary file modified incident_scraper/data/xgb_types.pkl
Binary file not shown.
Binary file modified incident_scraper/data/xgb_vectorizer.pkl
Binary file not shown.
342 changes: 162 additions & 180 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ scikit-multilearn = "^0.2.0"
polars = "^0.19.15"
pandas = "^2.1.3"
pyarrow = "^14.0.1"
xgboost = "^2.0.2"
xgboost = "2.0.3"
neattext = "^0.1.3"
click = "^8.1.7"
textblob = "^0.17.1"
Expand Down
311 changes: 154 additions & 157 deletions requirements.txt

Large diffs are not rendered by default.

0 comments on commit 626042c

Please sign in to comment.