Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WS-23-SAS-02
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Mutote
WS-23-SAS-02
Commits
c3dc14d5
Commit
c3dc14d5
authored
1 year ago
by
Fadi Gattoussi
Committed by
Michael Mutote
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
plots completed
parent
a6b55fa1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Main.py
+19
-6
19 additions, 6 deletions
Main.py
README.md
+1
-1
1 addition, 1 deletion
README.md
with
20 additions
and
7 deletions
Main.py
+
19
−
6
View file @
c3dc14d5
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
c3dc14d5
...
...
@@ -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.
-
`training
3
.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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment