Example #1
0
    def __setstate__(self, state):

        self.dim = state['dim']
        self.leaf_size = state['leaf_size']
        self.no_trees = state['no_trees']
        self._X = state['X']

        self.trees = []

        for tree_state in state['trees']:
            tree = Tree(self.leaf_size, self.dim)
            tree.deserialize(tree_state)
            self.trees.append(tree)
Example #2
0
    def __setstate__(self, state):

        self.dim = state['dim']
        self.leaf_size = state['leaf_size']
        self.no_trees = state['no_trees']
        self._X = state['X']

        self.trees = []

        for tree_state in state['trees']:
            tree = Tree(self.leaf_size, self.dim)
            tree.deserialize(tree_state)
            self.trees.append(tree)
Example #3
0
    def __setstate__(self, state):

        self.dim = state["dim"]
        self.leaf_size = state["leaf_size"]
        self.no_trees = state["no_trees"]
        self._X = state["X"]

        self.trees = []

        for tree_state in state["trees"]:
            tree = Tree(self.leaf_size, self.dim)
            tree.deserialize(tree_state, state.get("serialization_version", 1))
            self.trees.append(tree)

        # Make sure that when serialized again it gets the right serialization version
        self.serialization_version = SERIALIZATION_VERSION
    def __setstate__(self, state):

        self.dim = state['dim']
        self.leaf_size = state['leaf_size']
        self.no_trees = state['no_trees']
        self._X = state['X']

        self.trees = []

        for tree_state in state['trees']:
            tree = Tree(self.leaf_size, self.dim)
            tree.deserialize(tree_state, state.get('serialization_version', 1))
            self.trees.append(tree)

        # Make sure that when serialized again it gets the right serialization version
        self.serialization_version = SERIALIZATION_VERSION