/usr/lib/python2.7/dist-packages/pebl/learner/__init__.py is in python-pebl 1.0.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | from pebl import config, data, prior
#TODO: test
def fromconfig(data_=None, prior_=None):
learnertype = config.get('learner.type')
if ':' in learnertype:
CustomLearner(
data_ or data.fromconfig(),
prior_ or prior.fromconfig(),
learnerurl=learnertype
)
else:
learnermodule,learnerclass = learnertype.split('.')
mymod = __import__("pebl.learner.%s" % learnermodule, fromlist=['pebl.learner'])
mylearner = getattr(mymod, learnerclass)
return mylearner(data_ or data.fromconfig(), prior_ or prior.fromconfig())
|