Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
knutdrand committed Jan 26, 2024
2 parents 92e2835 + 68f3565 commit fdae97e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
19 changes: 19 additions & 0 deletions climate_health/predictor/poisson.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from climate_health.predictor.protocol import Predictor
import sklearn.linear_model as lm


class Poisson():
def __init__(self, alpha=1, fit_intercept=True):
self.model = lm.PoissonRegressor(alpha=alpha, fit_intercept=fit_intercept)

def predict(self, data):
self.model.predict(data)

def evaluate(self, data):
self.model.score(data, data)

def train(self, data):
self.model.fit(data)

# def evaluate(predictor: Predictor, data):
# return predictor.evaluate(data)
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ def predict(self, data):
def evaluate(self, data):
pass

def save(self, path):
pass

def load(self, path):
def train(self, data):
pass
2 changes: 2 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ hypothesis
coverage
pytest-cov
build
scikit-learn
numpy

0 comments on commit fdae97e

Please sign in to comment.