Skip to content

Commit

Permalink
update readme and main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dtruong46me committed Dec 29, 2023
1 parent 6e03aeb commit 7cbbc6d
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 58 deletions.
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
## Problem Description
The objective of this project are **analyze laptop prices** in 2023 based on data scraped from multiple websites and **predict a product's price** from a given set of input

- **Input**: Brand, CPU, GPU, RAM, Storage,...

- **Output**: Price

- **Demo**:
[](assets/demo.png)

- **Results**:
[](assets/result.png)

## Data

Expand All @@ -8,8 +19,29 @@

## Installation

## Contribution
1. Open terminal and clone the project
```
https://github.com/dncq/laptop-prices-analysis.git
```

2. Open terminal and install libraries
```
pip install requirements.txt
```

3. Run Streamlit on `/laptop-prices-analysis> `
```
streamlit run main.py
```

> [!NOTE]
> If you have trouble in install `streamlit` library, you can
## Contributions
|Name|Student ID|Email|
|:-:|:-:|:-:|
|Dinh Nguyen Cong Quy (C)|20214927|quy.dnc
|-|:-:|-|
|Dinh Nguyen Cong Quy (C)|20214927|quy.dnc214927@sis.hust.edu.vn|
|Le Tuan Anh|20214874|anh.lt214874@sis.hust.edu.vn|
|Vu Tuan Minh|20210597|minh.vt210597@sis.hust.edu.vn|
|Bui Minh Quang|20214925|quang.bm214925@sis.hust.edu.vn|
|Phan Dinh Truong|20214937|truong.pd214937@sis.hust.edu.vn|
Binary file added assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 7 additions & 53 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,56 +1,10 @@
import streamlit as st

laptop_config = {
'Company': ['Apple', 'Best Notebooks', 'Microsoft', 'GIGABYTE', 'Panasonic', 'Samsung', 'LG', 'MSI',
'Asus', 'Acer', 'HP', 'Lenovo',
'Dell'],
'CPU': ['i5', 'i7', 'Ryzen 5', 'Ryzen 7'],
'RAM': ['8GB', '16GB', '32GB'],
'GPU': ['Integrated', 'NVIDIA GTX', 'NVIDIA RTX', 'AMD Radeon'],
'Storage': ['256GB SSD', '512GB SSD', '1TB HDD', '1TB SSD']
}
import sys
import os

st.title('Are You Sure Prediction')
path = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, path)
from src.app.app import gui_app

st.button("Button thoi :)))")

st.caption("#fromhelaricawithluv")

st.checkbox("I am sure vailon!")

st.code('''def answer_tqk(question: str)
if question == "Are you sure?":
print("I am sure vailon")''')

company = st.selectbox('Brand', laptop_config['Company'])
cpu = st.selectbox('CPU', laptop_config['CPU'])
# ram = st.selectbox('RAM', laptop_config['RAM'])

ram = st.select_slider("RAM", options=['4GB', '8GB', '12GB', '16GB', '32GB', '64GB'])
gpu = st.selectbox('GPU', laptop_config['GPU'])
storage = st.selectbox('Storage', laptop_config['Storage'])

def predict_price(company, cpu, ram, gpu, storage):

return 1500000000


if st.button('Prediction'):
predicted_price = predict_price(company, cpu, ram, gpu, storage)

st.success(f'{predicted_price} USD')

st.camera_input('Camera nek')

st.download_button("Download Button", data="main.py")
st.code('''st.download_button("Download Button", data="str")
# data la string, khi download ve se thanh file txt chua doan string do''')

with st.form("This is form"):
st.write("Ben trong form nek")

st.slider("Slider nek", 15, 20)

st.checkbox("Checkbox nek")

st.form_submit_button("Submit")
if __name__=='__main__':
gui_app()
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pandas
numpy
matplotlib
pickle
sklearn
streamlit
seaborn
fuzzywuzzy
Binary file modified src/app/__pycache__/app.cpython-310.pyc
Binary file not shown.
6 changes: 4 additions & 2 deletions src/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import sys
import os

path = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, path)
from predict_price import *
from rf_predict_price import *

def main():
def gui_app():
st.title("Laptop Price Prediction")
st.caption("Introduction to Data Science")

Expand Down Expand Up @@ -138,4 +140,4 @@ def main():
st.success("0 USD")

if __name__ == '__main__':
main()
gui_app()

0 comments on commit 7cbbc6d

Please sign in to comment.