Skip to content
Snippets Groups Projects
Commit c3dc14d5 authored by Fadi Gattoussi's avatar Fadi Gattoussi Committed by Michael Mutote
Browse files

plots completed

parent a6b55fa1
No related branches found
No related tags found
No related merge requests found
......@@ -78,10 +78,10 @@ class MainWindow(QMainWindow):
self.GUI_selections = {}
# create new graphs
self.scatt = MplCanvas(self, width=6, height=5, dpi=100)
self.scatt.axes.set_title("Carats vs Price")
self.scatt.axes.scatter(diamonds['carat'], diamonds['price'], color='red', s=2)
# self.scatt.axes.scatter(self.GUI_selections['carat'], self.price, color='blue', s=50)
# self.scatt.axes.set_title("Carats vs Price")
# self.scatt.axes.scatter(diamonds['carat'], diamonds['price'], color='red', s=2, label='carat')
# self.scatt.axes.scatter(self.GUI_selections['carat'], self.price, color='blue', s=50, label='expected')
# Create labels and input fields
self.input_fields = [QComboBox(self), QComboBox(self), QComboBox(self), QLineEdit(self),
QLineEdit(self), QLineEdit(self), QLineEdit(self), QLineEdit(self),
......@@ -113,6 +113,7 @@ class MainWindow(QMainWindow):
self.setWindowTitle('Assistance Systems')
self.show()
def disable_input_field(self, field_name):
for key, value in self.menu_items.items():
if value == field_name:
......@@ -148,7 +149,19 @@ class MainWindow(QMainWindow):
self.price = model.predict_price(X_test)
# price = model.predict(X_test)[0]
self.display_price.setText(str(self.price))
self.update_graph()
self.create_graph()
def create_graph(self):
self.scatt.axes.clear()
self.scatt.axes.set_title("Carats vs Price")
self.scatt.axes.scatter(diamonds['carat'], diamonds['price'], color='red', s=2, label='carat')
self.scatt.axes.scatter(self.GUI_selections['carat'], self.price, color='blue', s=50, label='expected')
# self.scatt.axes.axhline(y=self.price, color='blue', linestyle='--', label='Predicted Price')
# self.scatt.axes.axhline(x=self.GUI_selections['carat'], color='blue', linestyle='--', label='carat')
# self.scatt.legend()
print("I am error")
self.scatt.draw()
def validate_inputs(self, val, attribute):
if Advanced.Advanced_selections[attribute]:
......@@ -291,4 +304,4 @@ app = QApplication(sys.argv)
window = MyTabs()
window.show()
app.exec()
\ No newline at end of file
app.exec()
......@@ -30,7 +30,7 @@ pip install -r requirements.txt
- `diamonds.csv`: Dataset containing diamond attributes.
- `Main.py`: Main Python script with GUI for prediction and visualization.
- `requirements.txt`: List of Python packages required for the project.
- `training3.ipynb`: Jupyter notebook for data preprocessing and analysis.
- `training.ipynb`: Jupyter notebook for data preprocessing and analysis.
## Contributing
Feel free to contribute to this project by submitting pull requests or suggesting improvements.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment