Skip to content

Commit

Permalink
wrapup
Browse files Browse the repository at this point in the history
  • Loading branch information
Damonamajor committed Jan 2, 2025
1 parent cbdfc59 commit 5d4b0a8
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions reports/performance/_model.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -1296,15 +1296,18 @@ training_data_monthly <- training_data_pred %>%
training_data_monthly_long <- training_data_monthly %>%
pivot_longer(
cols = c(variance_sale, variance_fmv, percent_sales, percent_sse, variance_diff),
cols = c(
variance_sale, variance_fmv, percent_sales,
percent_sse, variance_diff
),
names_to = "Metric",
values_to = "Value"
)
```

### Variance Ratio (FMV / Sale Price)

```{r _variance_ratio_chart}
```{r _model_variance_ratio_chart}
ggplot(training_data_monthly, aes(x = date, y = variance_ratio)) +
geom_line() +
geom_point() +
Expand All @@ -1317,9 +1320,10 @@ ggplot(training_data_monthly, aes(x = date, y = variance_ratio)) +

### Total FMV and Sale Price Variance

```{r _overall_variance_chart}
```{r _model_overall_variance_chart}
ggplot(
training_data_monthly_long %>% filter(Metric %in% c("variance_sale", "variance_fmv")),
training_data_monthly_long %>% filter(Metric %in%
c("variance_sale", "variance_fmv")),
aes(x = date, y = Value, color = Metric)
) +
geom_line() +
Expand All @@ -1346,13 +1350,13 @@ ggplot(

### Variance Difference (Sale Price - FMV)

```{r _variance_diff_chart}
```{r _model_variance_diff_chart}
ggplot(training_data_monthly, aes(x = date, y = variance_sale - variance_fmv)) +
geom_line() +
geom_point() +
geom_smooth(method = "loess", se = FALSE) +
labs(
x = "Month",
x = "Date",
y = "Difference in Variance"
) +
scale_y_continuous(labels = function(x) {
Expand All @@ -1364,16 +1368,19 @@ ggplot(training_data_monthly, aes(x = date, y = variance_sale - variance_fmv)) +

### Distribution of Sales and SSE

```{r _distribution_sales_sse_chart}
```{r _model_distribution_sales_sse_chart}
ggplot(training_data_monthly, aes(x = date)) +
geom_bar(aes(y = percent_sales, fill = "Sales"),
stat = "identity", position = "identity", alpha = 0.5
) +
geom_bar(aes(y = percent_sse, fill = "Sum of Square Errors"),
stat = "identity", position = "identity", alpha = 0.5
) +
scale_fill_manual(
values = c("Sales" = "#00BFC4", "Sum of Square Errors" = "#F8766D")
) +
labs(
x = "Month",
x = "Date",
y = "Normalized Scale",
fill = "",
) +
Expand Down

0 comments on commit 5d4b0a8

Please sign in to comment.