Skip to content

Commit

Permalink
Merge pull request #33 from GlobalFishingWatch/packaging
Browse files Browse the repository at this point in the history
Remove unnecessary dependencies
  • Loading branch information
Egil Möller committed May 18, 2016
2 parents a0b8435 + b324044 commit ce80724
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 60 deletions.
72 changes: 59 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,62 @@
bin/
local/
include/
share/
lib/
*~
*.pyc
classification-hourlyResultsAll.txt
*.csv
*.msg
datasets/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
.ipynb_checkpoints
MANIFEST
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Project development
.idea/
ignore/
venv/
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
language: python
sudo: false

cache:
directories:
- "~/.cache/pip"

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libfreetype6-dev
- libatlas-dev
- gfortran

python:
- 2.7

install:
- pip install pip setuptools wheel --upgrade
- pip install -e .\[dev\]

script:
- python -c "import vessel_scoring"

after_success:
- coveralls || echo "!! intermittent coveralls failure"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![Build Status](https://travis-ci.org/GlobalFishingWatch/vessel-scoring.svg?branch=master)](https://travis-ci.org/GlobalFishingWatch/vessel-scoring)

[![Coverage Status](https://coveralls.io/repos/github/GlobalFishingWatch/vessel-scoring/badge.svg?branch=master)](https://coveralls.io/github/GlobalFishingWatch/vessel-scoring?branch=master)

# About
This repository contains fishing scoring heuristics and evaluation of their effectiveness,
as well as development of supervised-ML scoring algorithms.
Expand Down
40 changes: 0 additions & 40 deletions requirements.txt

This file was deleted.

7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ def run(self):
packages=[
'vessel_scoring',
],
package_data={'vessel_scoring': ['models/*']},
install_requires=["numpy", "scikit_learn", "scipy", "matplotlib", "ipython"],
package_data={
'vessel_scoring': ['models/*']},
install_requires=["numpy", "scikit-learn", "scipy", "rolling_measures"],
extras_require={
'dev': ['matplotlib', 'ipython', 'coveralls']},
version='1.0',
author='Egil Moeller, Timothy Hochberg',
author_email='egil@skytruth.org, tim@skytruth.org',
Expand Down
12 changes: 7 additions & 5 deletions vessel_scoring/evaluate_model.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import matplotlib.pyplot as plt
from vessel_scoring import utils
import numpy as np
from sklearn import metrics
from IPython.core.display import display, HTML



def train_model(model, train_data):
Expand All @@ -22,12 +18,17 @@ def train_model(model, train_data):

# TODO break this into a plotting and a text part
def evaluate_model(model, test_data, name=None):
"""Plot some graphs and compute some metrics on a model
"""Plot some graphs and compute some metrics on a model. Requires
matplotlib and IPython.
model - a trained model
test_data - data to use on the evalutions
"""

import matplotlib.pyplot as plt
from IPython.core.display import display, HTML

is_fishy = utils.is_fishy(test_data)

score = model.predict_proba(test_data)[:,1]
Expand Down Expand Up @@ -91,6 +92,7 @@ def convert_range(ax_f):
overlap = total - non_overlap
error = overlap / total


def compare_models(models, test_data):
is_fishy = utils.is_fishy(test_data)

Expand Down

0 comments on commit ce80724

Please sign in to comment.