Skip to content

Commit

Permalink
Add initial poisson predictor
Browse files Browse the repository at this point in the history
  • Loading branch information
ghadialhajj committed Jan 26, 2024
1 parent bd6ecba commit 68f3565
Showing 1 changed file with 19 additions and 0 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)

0 comments on commit 68f3565

Please sign in to comment.