def __init__(self): super().__init__() self.data: Optional[Table] = None self.orig_data: Optional[Table] = None self.graph: ViolinPlot = None self._value_var_model: VariableListModel = None self._group_var_model: VariableListModel = None self._value_var_view: ListViewSearch = None self._group_var_view: ListViewSearch = None self._order_violins_cb: QCheckBox = None self._scale_combo: QComboBox = None self.selection = [] self.__pending_selection: List = self.selection_ranges self.setup_gui() VisualSettingsDialog( self, self.graph.parameter_setter.initial_settings )
def __init__(self, parent=None): super().__init__(parent) self.__groups = [] self.data = None self.valid_data = None self.subset_data = None self.subset_indices = None self.__pending_selection = self.selection self.graph_variables = [] self.graph = None self.group_vars = None self.group_view = None self.setup_gui() VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings) self.graph.view_box.selection_changed.connect(self.selection_changed) self.enable_selection.connect(self.graph.view_box.enable_selection)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.__results: Optional[RunnerResults] = None self.model: Optional[Model] = None self.background_data: Optional[Table] = None self.data: Optional[Table] = None # cached instance indices after instance ordering self.__data_idxs: Optional[np.ndarray] = None self.__pending_selection: List[Tuple[float, float]] = \ self.selection_ranges self.graph: ForcePlot = None self._target_combo: QComboBox = None self._order_combo: QComboBox = None self._annot_combo: QComboBox = None self.setup_gui() initial_settings = self.graph.parameter_setter.initial_settings VisualSettingsDialog(self, initial_settings)
def __init__(self): super().__init__() self.results = None self.scores = None self.classifier_names = [] self.colors = [] self.line = None self._last_score_value = -1 box = gui.vBox(self.controlArea, box="Settings") self.target_cb = gui.comboBox( box, self, "target_index", label="Target:", orientation=Qt.Horizontal, callback=self.target_index_changed, contentsLength=8, searchable=True) gui.checkBox( box, self, "display_rug", "Show rug", callback=self._on_display_rug_changed) gui.checkBox( box, self, "fold_curves", "Curves for individual folds", callback=self._replot) self.classifiers_list_box = gui.listBox( self.controlArea, self, "selected_classifiers", "classifier_names", box="Classifier", selectionMode=QListWidget.ExtendedSelection, sizePolicy=(QSizePolicy.Preferred, QSizePolicy.Preferred), sizeHint=QSize(150, 40), callback=self._on_selection_changed) box = gui.vBox(self.controlArea, "Metrics") combo = gui.comboBox( box, self, "score", items=(metric.name for metric in Metrics), callback=self.score_changed) self.explanation = gui.widgetLabel( box, wordWrap=True, fixedWidth=combo.sizeHint().width()) self.explanation.setContentsMargins(8, 8, 0, 0) font = self.explanation.font() font.setPointSizeF(0.85 * font.pointSizeF()) self.explanation.setFont(font) gui.radioButtons( box, self, value="output_calibration", btnLabels=("Sigmoid calibration", "Isotonic calibration"), label="Output model calibration", callback=self.commit.deferred) self.info_box = gui.widgetBox(self.controlArea, "Info") self.info_label = gui.widgetLabel(self.info_box) gui.auto_apply(self.buttonsArea, self, "auto_commit") self.plotview = GraphicsView() self.plot = PlotItem(enableMenu=False) self.plot.parameter_setter = ParameterSetter(self.plot) self.plot.setMouseEnabled(False, False) self.plot.hideButtons() for axis_name in ("bottom", "left"): axis = self.plot.getAxis(axis_name) # Remove the condition (that is, allow setting this for bottom # axis) when pyqtgraph is fixed # Issue: https://github.com/pyqtgraph/pyqtgraph/issues/930 # Pull request: https://github.com/pyqtgraph/pyqtgraph/pull/932 if axis_name != "bottom": # remove if when pyqtgraph is fixed axis.setStyle(stopAxisAtTick=(True, True)) self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05) self.plotview.setCentralItem(self.plot) self.mainArea.layout().addWidget(self.plotview) self._set_explanation() VisualSettingsDialog(self, self.plot.parameter_setter.initial_settings)
def __init__(self): super().__init__() self.results = None self.classifier_names = [] self.colors = [] self._points_hull: Dict[Tuple[int, int], PointsAndHull] = {} box = gui.vBox(self.controlArea, box="Curve") self.target_cb = gui.comboBox(box, self, "target_index", label="Target: ", orientation=Qt.Horizontal, callback=self._on_target_changed, contentsLength=8, searchable=True) gui.radioButtons(box, self, "curve_type", ("Lift Curve", "Cumulative Gains"), callback=self._on_curve_type_changed) self.classifiers_list_box = gui.listBox( self.controlArea, self, "selected_classifiers", "classifier_names", box="Models", selectionMode=QListView.MultiSelection, callback=self._on_classifiers_changed) self.classifiers_list_box.setMaximumHeight(100) gui.checkBox(self.controlArea, self, "display_convex_hull", "Show convex hull", box="Settings", callback=self._replot) gui.rubber(self.controlArea) self.plotview = pg.GraphicsView(background="w") self.plotview.setFrameStyle(QFrame.StyledPanel) axes = { "bottom": AxisItem(orientation="bottom"), "left": AxisItem(orientation="left") } self.plot = pg.PlotItem(enableMenu=False, axisItems=axes) self.plot.parameter_setter = ParameterSetter(self.plot) self.plot.curve_items = [] self.plot.hull_items = [] self.plot.default_line_item = None self.plot.display_convex_hull = self.display_convex_hull self.plot.setMouseEnabled(False, False) self.plot.hideButtons() pen = QPen(self.palette().color(QPalette.Text)) tickfont = QFont(self.font()) tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11)) for pos, label in (("bottom", "P Rate"), ("left", "")): axis = self.plot.getAxis(pos) axis.setTickFont(tickfont) axis.setPen(pen) axis.setLabel(label) self._set_left_label() self.plot.showGrid(True, True, alpha=0.1) self.plotview.setCentralItem(self.plot) self.mainArea.layout().addWidget(self.plotview) VisualSettingsDialog(self, self.plot.parameter_setter.initial_settings)