Created
September 21, 2016 03:12
-
-
Save kmaehashi/b0e1bde84e582bb56f5c58e5bf5be74f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__all__ = [ | |
'ConfigFile', | |
'Anomaly', | |
'Bandit', | |
'Burst', | |
'Classifier', | |
'Clustering', | |
'NearestNeighbor', | |
'Recommender', | |
'Regression', | |
'Stat', | |
'Graph', | |
'Weight', | |
] | |
class ConfigFile(dict): | |
def __init__(self, filename): | |
with open(filename) as f: | |
self.update(json.load(f)) | |
class _EmbeddedUnavailable(object): | |
def __init__(self, *args, **kwargs): | |
raise RuntimeError('Embedded Jubatus Python module is not installed.') | |
# Remove the following code once embedded_jubatus supports these engine. | |
class _EmbeddedNotImplemented(object): | |
def __init__(self, *args, **kwargs): | |
raise RuntimeError('Embedded Jubatus Python module currently does not support this engine.') | |
Graph = _EmbeddedNotImplemented | |
Weight = _EmbeddedNotImplemented | |
try: | |
from embedded_jubatus import * | |
except ImportError: | |
Anomaly = _EmbeddedUnavailable | |
Bandit = _EmbeddedUnavailable | |
Burst = _EmbeddedUnavailable | |
Classifier = _EmbeddedUnavailable | |
Clustering = _EmbeddedUnavailable | |
NearestNeighbor = _EmbeddedUnavailable | |
Recommender = _EmbeddedUnavailable | |
Regression = _EmbeddedUnavailable | |
Stat = _EmbeddedUnavailable | |
Graph = _EmbeddedUnavailable | |
Weight = _EmbeddedUnavailable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment