(self, model=None)
When a different forest is given.
When a different forest is given.
When a different forest is given .
def set_rf(self, model=None):
        """When a different forest is given."""
        self.closeContext()
        self.clear()
        self.rf_model = model

        if model is not None:
            self.instances = model.instances
            self._update_target_class_combo()

            self.forest = self._get_forest_adapter(self.rf_model)
            self.forest_model[:] = self.forest.trees

            self._update_info_box()
            self._update_depth_slider()

            self.openContext(
                model.domain.class_var if model.domain is not None else None
            )
        # Restore item selection
        if self.selected_index is not None:
            index = self.list_view.model().index(self.selected_index)
            selection = QItemSelection(index, index)
            self.list_view.selectionModel().select(selection, QItemSelectionModel.ClearAndSelect)
def set_rf ( self , model = None ) : self . closeContext ( ) self . clear ( ) self . rf_model = model if model is not None : self . instances = model . instances self . _update_target_class_combo ( ) self . forest = self . _get_forest_adapter ( self . rf_model ) self . forest_model [ : ] = self . forest . trees self . _update_info_box ( ) self . _update_depth_slider ( ) self . openContext ( model . domain . class_var if model . domain is not None else None ) # Restore item selection if self . selected_index is not None : index = self . list_view . model ( ) . index ( self . selected_index ) selection = QItemSelection ( index , index ) self . list_view . selectionModel ( ) . select ( selection , QItemSelectionModel . ClearAndSelect )