def __init__(self, state={}):

        if 'nearest_neighbors_model' not in state:
            state['nearest_neighbors_model'] = None

        assert (isinstance(state['nearest_neighbors_model'],
                           _gl.nearest_neighbors.NearestNeighborsModel))

        self.__proxy__ = _PythonProxy(state)
    def __init__(self, state={}):

        if 'nearest_neighbors_model' not in state:
            state['nearest_neighbors_model'] = None
        if state['nearest_neighbors_model'] and not isinstance(state['nearest_neighbors_model'],
               _gl.nearest_neighbors._nearest_neighbors.NearestNeighborsModel):
            raise TypeError("The internal nearest neighbors model for LocalOutlierFactorModel is not correct.")

        self.__proxy__ = _PythonProxy(state)
Пример #3
0
    def _setup(self):
        """
        Sets up the model; common between __init__ and load.
        """
        self.__proxy__ = _PythonProxy()

        #Try importing spacy
        if SpacyTransformer._nlp is None:
            SpacyTransformer._nlp = _import_spacy()
Пример #4
0
    def __init__(self, state={}):

        if 'nearest_neighbors_model' in state:
            model = state['nearest_neighbors_model']
        else:
            model = None

        assert (isinstance(model, _gl.nearest_neighbors.NearestNeighborsModel))

        if model.get("distance") == "dot_product":
            raise _ToolkitError("%s is not a supported distance function for " \
                                "the NearestNeighborAutoTagger. Use %s " \
                                "instead." % ("dot_product", "cosine"))

        if model.get("distance") == "transformed_dot_product":
            raise _ToolkitError("%s is not a supported distance function for " \
                                "the NearestNeighborAutoTagger. Use %s " \
                                "instead." % ("transformed_dot_product", "cosine"))

        self.__proxy__ = _PythonProxy(state)
Пример #5
0
 def _setup(self):
     self.__proxy__ = _PythonProxy()
Пример #6
0
 def _setup(self):
     """
     Sets stuff up.
     """
     self.__proxy__ = _PythonProxy()
Пример #7
0
    def __init__(self, state=None):
        if state is None:
            state = {}

        self.__proxy__ = _PythonProxy(state)
Пример #8
0
 def __init__(self, state):
     self.__proxy__ = _PythonProxy(state)