Finish all learners, but they don't pass tests. I have to figure out why they perform so bad.
This commit is contained in:
28
assess_learners/InsaneLearner.py
Normal file
28
assess_learners/InsaneLearner.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import BagLearner as bgl
|
||||
import LinRegLearner as lrl
|
||||
|
||||
class InsaneLearner(object):
|
||||
def __init__(self, verbose=False):
|
||||
def bag_learner():
|
||||
return bgl.BagLearner(lrl.LinRegLearner, bags=20, verbose=verbose)
|
||||
self.learner = bgl.BagLearner(bag_learner, bags=20, verbose=verbose)
|
||||
|
||||
def author(self):
|
||||
return 'felixm' # replace tb34 with your Georgia Tech username
|
||||
|
||||
def addEvidence(self, data_x, data_y):
|
||||
"""
|
||||
@summary: Add training data to learner
|
||||
@param dataX: X values of data to add
|
||||
@param dataY: the Y training values
|
||||
"""
|
||||
self.learner.addEvidence(data_x, data_y)
|
||||
|
||||
def query(self, points):
|
||||
"""
|
||||
@summary: Estimate a set of test points given the model we built.
|
||||
@param points: should be a numpy array with each row corresponding to a specific query.
|
||||
@returns the estimated values according to the saved model.
|
||||
"""
|
||||
return self.learner.query(points)
|
||||
|
||||
Reference in New Issue
Block a user