Update src/streamlit_app.py
Browse files- src/streamlit_app.py +97 -83
src/streamlit_app.py
CHANGED
|
@@ -1,83 +1,97 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
)
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Installing packages into β/usr/local/lib/R/site-libraryβ
|
| 2 |
+
(as βlibβ is unspecified)
|
| 3 |
+
|
| 4 |
+
also installing the dependency βvroomβ
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
Warning message in install.packages(c("readr", "dplyr", "ggplot2", "corrplot")):
|
| 8 |
+
βinstallation of package βggplot2β had non-zero exit statusβ
|
| 9 |
+
|
| 10 |
+
Attaching package: βdplyrβ
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
The following objects are masked from βpackage:statsβ:
|
| 14 |
+
|
| 15 |
+
filter, lag
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
The following objects are masked from βpackage:baseβ:
|
| 19 |
+
|
| 20 |
+
intersect, setdiff, setequal, union
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
corrplot 0.95 loaded
|
| 24 |
+
|
| 25 |
+
Rows: 52820 Columns: 5
|
| 26 |
+
ββ Column specification ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 27 |
+
Delimiter: ","
|
| 28 |
+
dbl (5): price, surface, rooms, price_m2, neighborhood_score
|
| 29 |
+
|
| 30 |
+
βΉ Use `spec()` to retrieve the full column specification for this data.
|
| 31 |
+
βΉ Specify the column types or set `show_col_types = FALSE` to quiet this message.
|
| 32 |
+
[1] "Dataset loaded successfully"
|
| 33 |
+
A tibble: 6 Γ 5
|
| 34 |
+
price surface rooms price_m2 neighborhood_score
|
| 35 |
+
<dbl> <dbl> <dbl> <dbl> <dbl>
|
| 36 |
+
121000 69 2 1753.623 6.200
|
| 37 |
+
246000 49 2 5020.408 5.015
|
| 38 |
+
318050 115 6 2765.652 6.350
|
| 39 |
+
163000 42 2 3880.952 6.350
|
| 40 |
+
150000 93 5 1612.903 6.350
|
| 41 |
+
153000 46 2 3326.087 5.935
|
| 42 |
+
spc_tbl_ [52,820 Γ 5] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
|
| 43 |
+
$ price : num [1:52820] 121000 246000 318050 163000 150000 ...
|
| 44 |
+
$ surface : num [1:52820] 69 49 115 42 93 46 32 83 70 25 ...
|
| 45 |
+
$ rooms : num [1:52820] 2 2 6 2 5 2 2 4 3 1 ...
|
| 46 |
+
$ price_m2 : num [1:52820] 1754 5020 2766 3881 1613 ...
|
| 47 |
+
$ neighborhood_score: num [1:52820] 6.2 5.02 6.35 6.35 6.35 ...
|
| 48 |
+
- attr(*, "spec")=
|
| 49 |
+
.. cols(
|
| 50 |
+
.. price = col_double(),
|
| 51 |
+
.. surface = col_double(),
|
| 52 |
+
.. rooms = col_double(),
|
| 53 |
+
.. price_m2 = col_double(),
|
| 54 |
+
.. neighborhood_score = col_double()
|
| 55 |
+
.. )
|
| 56 |
+
- attr(*, "problems")=<externalptr>
|
| 57 |
+
price surface rooms price_m2
|
| 58 |
+
Min. : 1 Min. : 1.00 Min. : 0.000 Min. : 0
|
| 59 |
+
1st Qu.: 185000 1st Qu.: 40.00 1st Qu.: 2.000 1st Qu.: 3193
|
| 60 |
+
Median : 290000 Median : 62.00 Median : 3.000 Median : 4800
|
| 61 |
+
Mean : 405173 Mean : 69.16 Mean : 3.116 Mean : 7332
|
| 62 |
+
3rd Qu.: 464598 3rd Qu.: 88.00 3rd Qu.: 4.000 3rd Qu.: 8341
|
| 63 |
+
Max. :2990000 Max. :482.00 Max. :24.000 Max. :666667
|
| 64 |
+
neighborhood_score
|
| 65 |
+
Min. : 3.885
|
| 66 |
+
1st Qu.: 6.727
|
| 67 |
+
Median : 7.780
|
| 68 |
+
Mean : 7.870
|
| 69 |
+
3rd Qu.: 9.290
|
| 70 |
+
Max. :20.504
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
Call:
|
| 77 |
+
lm(formula = price ~ surface + rooms + neighborhood_score, data = train)
|
| 78 |
+
|
| 79 |
+
Residuals:
|
| 80 |
+
Min 1Q Median 3Q Max
|
| 81 |
+
-1815140 -145637 -68531 35243 2767231
|
| 82 |
+
|
| 83 |
+
Coefficients:
|
| 84 |
+
Estimate Std. Error t value Pr(>|t|)
|
| 85 |
+
(Intercept) -467418.10 10358.66 -45.12 <2e-16 ***
|
| 86 |
+
surface 4932.35 76.81 64.21 <2e-16 ***
|
| 87 |
+
rooms -29954.53 2059.06 -14.55 <2e-16 ***
|
| 88 |
+
neighborhood_score 79383.79 1120.02 70.88 <2e-16 ***
|
| 89 |
+
---
|
| 90 |
+
Signif. codes: 0 β***β 0.001 β**β 0.01 β*β 0.05 β.β 0.1 β β 1
|
| 91 |
+
|
| 92 |
+
Residual standard error: 341000 on 42252 degrees of freedom
|
| 93 |
+
Multiple R-squared: 0.2284, Adjusted R-squared: 0.2283
|
| 94 |
+
F-statistic: 4169 on 3 and 42252 DF, p-value: < 2.2e-16
|
| 95 |
+
[1] "RMSE: 339999.604607665"
|
| 96 |
+
|
| 97 |
+
[1] "Model results saved successfully"
|