diff --git a/DisplayWindow.py b/DisplayWindow.py index 0bb95e8b33a5f04f2653f6d2d42a0af9fa93f064..c4f363662b841a0b2fcda253b6c5d6672beba513 100644 --- a/DisplayWindow.py +++ b/DisplayWindow.py @@ -64,7 +64,7 @@ class MainWindow(QMainWindow): # Create a plot widget graphWidget = pg.PlotWidget(self) graphWidget.setBackground('w') - graphWidget.plot([1, 2, 3], [6, 8, 2]) + graphWidget.plot(RegressionModel.diamonds['carat'], RegressionModel.diamonds['price']) # Add the plot widget to the grid layout grid_layout.addWidget(self.calculate_button, 2, 0, 1, 2) @@ -100,14 +100,30 @@ class Advanced(QMainWindow): # Create a grid layout and set it to the central widget grid_layout = QGridLayout(central_widget) + self.graph_selector_X = QComboBox(self) + self.graph_selector_Y = QComboBox(self) + self.regression_model = QComboBox(self) self.check_labels = ['Cut', 'Colour', 'Clarity', 'Carat', 'Depth', 'Table', 'X', 'Y', 'Z'] + self.graph_selector_X.addItems((self.check_labels + ['price'])) + self.graph_selector_Y.addItems((self.check_labels + ['price'])) + self.regression_model.addItems(["Linear Regression", "Gradient Descent", "Random Forest"]) self.checkboxes = [] - grid_layout.addWidget(QLabel("select features to include in Modelling"), 0, 0) + + + grid_layout.addWidget(QLabel("select features to include in Modelling"), 0, 0, 1, 0) + # grid_layout.addWidget(self.graph_selector_X, 1, 2) + # grid_layout.addWidget(self.graph_selector_Y, 1, 3) + grid_layout.addWidget(self.regression_model, 2, 1) + # grid_layout.addWidget(QLabel("X-PLOT", self), 0, 2) + # grid_layout.addWidget(QLabel("Y-PLOT", self), 0, 3) + grid_layout.addWidget(QLabel("Regression Model : ", self), 2, 0,1,1) + + for i, label in enumerate(self.check_labels): checkbox = QCheckBox(label, self) checkbox.setChecked(True) checkbox.stateChanged.connect(self.handle_checkbox_state) # Connect signal - grid_layout.addWidget(checkbox, i, 1) + grid_layout.addWidget(checkbox, 1, i) self.checkboxes.append(checkbox) # Store checkboxes in the list def handle_checkbox_state(self):