ryantrisnadi commited on
Commit
27b036b
1 Parent(s): 4d5b359

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +124 -33
app.py CHANGED
@@ -1,33 +1,124 @@
1
- import streamlit as st
2
- import pandas as pd
3
- import joblib
4
-
5
- import streamlit as st
6
- import eda
7
- import models
8
-
9
-
10
- page = st.sidebar.selectbox(label='Select Page:', options=['Home Page', 'Exploration Data Analysis', 'Model Prediksi'])
11
-
12
- if page == 'Home Page':
13
- st.header('Welcome Page')
14
- st.write('')
15
- st.write('Milestone 2')
16
- st.write('Nama : Ryan Trisnadi')
17
- st.write('Batch : ')
18
- st.write('Tujuan Milestone : Prediksi harga rumah di Melbourne')
19
- st.write('')
20
- st.caption('Silahkan pilih menu lain di Select Box pada sebelah kiri layar anda untuk memulai!')
21
- st.write('')
22
- st.write('')
23
- with st.expander("Latar Belakang"):
24
- st.caption('Proyek ini dibuat untuk mengilustrasikan dan memproyek kedepan harga rumah di kota Melbourne, Australia. Kita akan menguji dengan Linear regression
25
- dengan beberapa test algorithma seperti SVM, Decision Tree, Random Forest, dan Boosting. Oleh karena itu, kita akan memilih variable "price" atau harga
26
- rumah sebagai target. Dengan mengunakan Pipeline di setiap proses dari Feature Engineering, kita bisa membuat proses lebih efisien dan mencegah data leak.
27
- Dataset tersebut memiliki beberapa faktor seperti alamat, kode pos, harga rumah, lokasi lingkungan, kamar, kamar mandi, garasi, besar tanah, umur dan
28
- lain-lain'.)
29
-
30
- elif page == 'Exploration Data Analysis':
31
- eda.run()
32
- else:
33
- models.run()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask, render_template_string
2
+
3
+ app = Flask(__name__)
4
+
5
+ # Introduction content
6
+ intro_content = """
7
+ <!doctype html>
8
+ <html lang="en">
9
+ <head>
10
+ <meta charset="utf-8">
11
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
12
+ <title>Project Introduction</title>
13
+ <style>
14
+ body {
15
+ font-family: Arial, sans-serif;
16
+ margin: 40px;
17
+ }
18
+ h1 {
19
+ color: #333;
20
+ }
21
+ p {
22
+ font-size: 18px;
23
+ }
24
+ pre {
25
+ background: #f4f4f4;
26
+ padding: 10px;
27
+ border-radius: 5px;
28
+ }
29
+ </style>
30
+ </head>
31
+ <body>
32
+ <h1>Project Title</h1>
33
+ <p><strong>Description:</strong> A brief summary of what your project does and its main features.</p>
34
+
35
+ <h2>Project Overview</h2>
36
+ <p>Detailed explanation of the project, its goals, and key functionalities.</p>
37
+
38
+ <h2>Installation</h2>
39
+ <pre><code>
40
+ # Step-by-step instructions on how to install your project.
41
+ pip install your-project
42
+ </code></pre>
43
+
44
+ <h2>Usage</h2>
45
+ <pre><code>
46
+ # Instructions on how to use your project with code snippets.
47
+ from your_project import YourModel
48
+
49
+ model = YourModel()
50
+ result = model.predict("Sample input")
51
+ print(result)
52
+ </code></pre>
53
+
54
+ <h2>Dataset and Model Information</h2>
55
+ <p>Information about the dataset and model architecture.</p>
56
+
57
+ <h2>Results and Performance</h2>
58
+ <p>Metrics, visualizations, and comparisons showcasing the performance of your model.</p>
59
+
60
+ <h2>How to Contribute</h2>
61
+ <p>Guidelines for contributing to your project.</p>
62
+
63
+ <h2>License</h2>
64
+ <p>The license for your project.</p>
65
+
66
+ <h2>Citation</h2>
67
+ <p>How to cite your work if applicable.</p>
68
+ </body>
69
+ </html>
70
+ """
71
+
72
+ @app.route('/')
73
+ def home():
74
+ return render_template_string(intro_content)
75
+
76
+ if __name__ == '__main__':
77
+ app.run(debug=True)
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+ # import streamlit as st
89
+ # import pandas as pd
90
+ # import joblib
91
+
92
+ # import streamlit as st
93
+ # import eda
94
+ # import models
95
+
96
+
97
+ # page = st.sidebar.selectbox(label='Select Page:', options=['Home Page', 'Exploration Data Analysis', 'Model Prediksi'])
98
+
99
+ # if page == 'Home Page':
100
+ # st.header('Welcome Page')
101
+ # st.write('')
102
+ # st.write('Milestone 2')
103
+ # st.write('Nama : Ryan Trisnadi')
104
+ # st.write('Batch : ')
105
+ # st.write('Tujuan Milestone : Prediksi harga rumah di Melbourne')
106
+ # st.write('')
107
+ # st.caption('Silahkan pilih menu lain di Select Box pada sebelah kiri layar anda untuk memulai!')
108
+ # st.write('')
109
+ # st.write('')
110
+ # with st.expander("Latar Belakang"):
111
+ # st.caption('Proyek ini dibuat untuk mengilustrasikan dan memproyek kedepan harga rumah di kota Melbourne, Australia. Kita akan menguji dengan Linear regression
112
+ # dengan beberapa test algorithma seperti SVM, Decision Tree, Random Forest, dan Boosting. Oleh karena itu, kita akan memilih variable "price" atau harga
113
+ # rumah sebagai target. Dengan mengunakan Pipeline di setiap proses dari Feature Engineering, kita bisa membuat proses lebih efisien dan mencegah data leak.
114
+ # Dataset tersebut memiliki beberapa faktor seperti alamat, kode pos, harga rumah, lokasi lingkungan, kamar, kamar mandi, garasi, besar tanah, umur dan
115
+ # lain-lain'.)
116
+
117
+ # elif page == 'Exploration Data Analysis':
118
+ # eda.run()
119
+ # else:
120
+ # models.run()
121
+
122
+
123
+
124
+