Spaces:
Running
Running
0.2.3 - Added MMC
Browse files
app/app.R
CHANGED
@@ -53,6 +53,7 @@ reformat_data <- function(d_raw) {
|
|
53 |
"corr20V2", "corr20V2Percentile",
|
54 |
"fncV3", "fncV3Percentile",
|
55 |
"tc", "tcPercentile",
|
|
|
56 |
"corrWMetamodel",
|
57 |
"apcwnm", "mcwnm",
|
58 |
"roundPayoutFactor", "payout")
|
@@ -66,6 +67,7 @@ reformat_data <- function(d_raw) {
|
|
66 |
d_munged[, corr20V2Percentile := round(corr20V2Percentile * 100, 6)]
|
67 |
d_munged[, fncV3Percentile := round(fncV3Percentile * 100, 6)]
|
68 |
d_munged[, tcPercentile := round(tcPercentile * 100, 6)]
|
|
|
69 |
|
70 |
# Rename columns
|
71 |
colnames(d_munged) <- c("model", "round",
|
@@ -74,6 +76,7 @@ reformat_data <- function(d_raw) {
|
|
74 |
"corrV2", "corrV2_pct",
|
75 |
"fncV3", "fncV3_pct",
|
76 |
"tc", "tc_pct",
|
|
|
77 |
"corr_meta",
|
78 |
"apcwnm", "mcwnm",
|
79 |
"pay_ftr", "payout")
|
@@ -201,20 +204,7 @@ ui <- shinydashboardPlus::dashboardPage(
|
|
201 |
|
202 |
pickerInput(inputId = "model",
|
203 |
label = " ",
|
204 |
-
|
205 |
-
choices = unique(c(sort(Rnumerai::get_leaderboard()$username)
|
206 |
-
# "joe_the_validator_01",
|
207 |
-
# "joe_the_validator_02",
|
208 |
-
# "joe_the_validator_03",
|
209 |
-
# "joe_the_validator_04",
|
210 |
-
# "joe_the_validator_05"
|
211 |
-
# "joe_the_hedgehog_01",
|
212 |
-
# "joe_the_hedgehog_02",
|
213 |
-
# "joe_the_hedgehog_03",
|
214 |
-
# "joe_the_hedgehog_04",
|
215 |
-
# "joe_the_hedgehog_05"
|
216 |
-
)
|
217 |
-
),
|
218 |
multiple = TRUE,
|
219 |
width = "100%",
|
220 |
options = list(
|
@@ -318,53 +308,8 @@ ui <- shinydashboardPlus::dashboardPage(
|
|
318 |
br(),
|
319 |
|
320 |
tabsetPanel(type = "tabs",
|
321 |
-
|
322 |
-
|
323 |
-
tabPanel("KPI (C&T)",
|
324 |
-
|
325 |
-
br(),
|
326 |
-
|
327 |
-
h3(strong(textOutput(outputId = "text_performance_models"))),
|
328 |
-
|
329 |
-
h4(textOutput(outputId = "text_performance_models_note")),
|
330 |
-
|
331 |
-
br(),
|
332 |
-
|
333 |
-
fluidRow(
|
334 |
-
column(width = 6, plotlyOutput("plot_performance_avg")),
|
335 |
-
column(width = 6, plotlyOutput("plot_performance_sharpe"))
|
336 |
-
),
|
337 |
-
|
338 |
-
br(),
|
339 |
-
br(),
|
340 |
-
br(),
|
341 |
-
|
342 |
-
fluidRow(DTOutput("dt_performance_summary"),
|
343 |
-
|
344 |
-
br(),
|
345 |
-
|
346 |
-
markdown("#### **Notes**:
|
347 |
-
|
348 |
-
- **avg_corrV2**: Average `CORRv2`
|
349 |
-
- **sharpe_corrV2**: Sharpe Ratio of `CORRv2`
|
350 |
-
|
351 |
-
- **avg_tc**: Average True Contribution (`TC`)
|
352 |
-
- **sharpe_tc**: Sharpe Ratio of True Contribution (`TC`)
|
353 |
-
|
354 |
-
- **avg_2C1T**: Average `2xCORRv2 + 1xTC`
|
355 |
-
- **sharpe_2C1T**: Sharpe Ratio of `2xCORRv2 + 1xTC`
|
356 |
-
|
357 |
-
"),
|
358 |
-
|
359 |
-
br()
|
360 |
-
),
|
361 |
-
|
362 |
-
|
363 |
-
br()
|
364 |
-
|
365 |
-
),
|
366 |
-
|
367 |
-
# Coming soon
|
368 |
tabPanel("KPI (All)",
|
369 |
|
370 |
br(),
|
@@ -383,7 +328,8 @@ ui <- shinydashboardPlus::dashboardPage(
|
|
383 |
markdown("#### **Pick ONE of the KPIs:**"),
|
384 |
pickerInput(
|
385 |
inputId = "kpi_choice",
|
386 |
-
choices = c("
|
|
|
387 |
"TC: True Contribtuion to the hedge fund's returns",
|
388 |
"FNCv3: Feature Neutral Correlation with respect to the FNCv3 features",
|
389 |
# "CORJ60: CORRelation with target Jerome_v4_60", # add this later
|
@@ -456,6 +402,50 @@ ui <- shinydashboardPlus::dashboardPage(
|
|
456 |
),
|
457 |
|
458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
459 |
|
460 |
tabPanel("Payout (Overview)",
|
461 |
|
@@ -672,6 +662,7 @@ ui <- shinydashboardPlus::dashboardPage(
|
|
672 |
- #### **0.2.0** — Replaced `Payout Summary` with `Performance Summary`. Added KPIs summary
|
673 |
- #### **0.2.1** — Added `KPI (All)`
|
674 |
- #### **0.2.2** — Sped up chart rendering with `toWebGL()`
|
|
|
675 |
"),
|
676 |
|
677 |
br(),
|
@@ -690,7 +681,7 @@ ui <- shinydashboardPlus::dashboardPage(
|
|
690 |
|
691 |
footer = shinydashboardPlus::dashboardFooter(
|
692 |
left = "Powered by ❤️, ☕, Shiny, and 🤗 Spaces",
|
693 |
-
right = paste0("Version 0.2.
|
694 |
|
695 |
)
|
696 |
|
@@ -786,9 +777,9 @@ server <- function(input, output) {
|
|
786 |
) |>
|
787 |
|
788 |
# Reformat individual columns
|
789 |
-
formatRound(columns = c("corrV2", "tc", "fncV3", "corr_meta", "pay_ftr"), digits = 4) |>
|
790 |
formatRound(columns = c("apcwnm", "mcwnm"), digits = 4) |>
|
791 |
-
formatRound(columns = c("corrV2_pct", "tc_pct", "fncV3_pct"), digits = 1) |>
|
792 |
formatRound(columns = c("stake", "payout"), digits = 2) |>
|
793 |
|
794 |
formatStyle(columns = c("model"),
|
@@ -798,13 +789,13 @@ server <- function(input, output) {
|
|
798 |
fontWeight = "bold",
|
799 |
color = styleInterval(cuts = -1e-15, values = c("#D24141", "#2196F3"))) |>
|
800 |
|
801 |
-
formatStyle(columns = c("corrV2", "fncV3"),
|
802 |
color = styleInterval(cuts = -1e-15, values = c("#D24141", "black"))) |>
|
803 |
|
804 |
formatStyle(columns = c("tc"),
|
805 |
color = styleInterval(cuts = -1e-15, values = c("#D24141", "#A278DC"))) |>
|
806 |
|
807 |
-
formatStyle(columns = c("corrV2_pct", "tc_pct", "fncV3_pct"),
|
808 |
color = styleInterval(cuts = c(1, 5, 15, 85, 95, 99),
|
809 |
values = c("#692020", "#9A2F2F", "#D24141",
|
810 |
"#D1D1D1", # light grey
|
@@ -1056,6 +1047,7 @@ server <- function(input, output) {
|
|
1056 |
d_pref[stake >0, rate_of_return := payout / stake * 100]
|
1057 |
|
1058 |
# Extract Raw KPI
|
|
|
1059 |
if (input$kpi_choice == "CORRv2: CORRelation with target cyrus_v4_20") d_pref[, KPI := corrV2]
|
1060 |
if (input$kpi_choice == "TC: True Contribtuion to the hedge fund's returns") d_pref[, KPI := tc]
|
1061 |
if (input$kpi_choice == "FNCv3: Feature Neutral Correlation with respect to the FNCv3 features") d_pref[, KPI := fncV3]
|
@@ -1544,6 +1536,7 @@ server <- function(input, output) {
|
|
1544 |
d_kpi <- react_d_kpi()
|
1545 |
|
1546 |
# Dynamic Labels
|
|
|
1547 |
if (input$kpi_choice == "CORRv2: CORRelation with target cyrus_v4_20") y_label <- "CORRv2"
|
1548 |
if (input$kpi_choice == "TC: True Contribtuion to the hedge fund's returns") y_label <- "TC"
|
1549 |
if (input$kpi_choice == "FNCv3: Feature Neutral Correlation with respect to the FNCv3 features") y_label <- "FNCv3"
|
|
|
53 |
"corr20V2", "corr20V2Percentile",
|
54 |
"fncV3", "fncV3Percentile",
|
55 |
"tc", "tcPercentile",
|
56 |
+
"mmc", "mmcPercentile",
|
57 |
"corrWMetamodel",
|
58 |
"apcwnm", "mcwnm",
|
59 |
"roundPayoutFactor", "payout")
|
|
|
67 |
d_munged[, corr20V2Percentile := round(corr20V2Percentile * 100, 6)]
|
68 |
d_munged[, fncV3Percentile := round(fncV3Percentile * 100, 6)]
|
69 |
d_munged[, tcPercentile := round(tcPercentile * 100, 6)]
|
70 |
+
d_munged[, mmcPercentile := round(mmcPercentile * 100, 6)]
|
71 |
|
72 |
# Rename columns
|
73 |
colnames(d_munged) <- c("model", "round",
|
|
|
76 |
"corrV2", "corrV2_pct",
|
77 |
"fncV3", "fncV3_pct",
|
78 |
"tc", "tc_pct",
|
79 |
+
"mmc", "mmc_pct",
|
80 |
"corr_meta",
|
81 |
"apcwnm", "mcwnm",
|
82 |
"pay_ftr", "payout")
|
|
|
204 |
|
205 |
pickerInput(inputId = "model",
|
206 |
label = " ",
|
207 |
+
choices = sort(Rnumerai::get_leaderboard()$username),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
multiple = TRUE,
|
209 |
width = "100%",
|
210 |
options = list(
|
|
|
308 |
br(),
|
309 |
|
310 |
tabsetPanel(type = "tabs",
|
311 |
+
|
312 |
+
# First Page - All KPIs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
tabPanel("KPI (All)",
|
314 |
|
315 |
br(),
|
|
|
328 |
markdown("#### **Pick ONE of the KPIs:**"),
|
329 |
pickerInput(
|
330 |
inputId = "kpi_choice",
|
331 |
+
choices = c("MMCv2: The Latest and the Greatest MMC",
|
332 |
+
"CORRv2: CORRelation with target cyrus_v4_20",
|
333 |
"TC: True Contribtuion to the hedge fund's returns",
|
334 |
"FNCv3: Feature Neutral Correlation with respect to the FNCv3 features",
|
335 |
# "CORJ60: CORRelation with target Jerome_v4_60", # add this later
|
|
|
402 |
),
|
403 |
|
404 |
|
405 |
+
tabPanel("KPI (C&T)",
|
406 |
+
|
407 |
+
br(),
|
408 |
+
|
409 |
+
h3(strong(textOutput(outputId = "text_performance_models"))),
|
410 |
+
|
411 |
+
h4(textOutput(outputId = "text_performance_models_note")),
|
412 |
+
|
413 |
+
br(),
|
414 |
+
|
415 |
+
fluidRow(
|
416 |
+
column(width = 6, plotlyOutput("plot_performance_avg")),
|
417 |
+
column(width = 6, plotlyOutput("plot_performance_sharpe"))
|
418 |
+
),
|
419 |
+
|
420 |
+
br(),
|
421 |
+
br(),
|
422 |
+
br(),
|
423 |
+
|
424 |
+
fluidRow(DTOutput("dt_performance_summary"),
|
425 |
+
|
426 |
+
br(),
|
427 |
+
|
428 |
+
markdown("#### **Notes**:
|
429 |
+
|
430 |
+
- **avg_corrV2**: Average `CORRv2`
|
431 |
+
- **sharpe_corrV2**: Sharpe Ratio of `CORRv2`
|
432 |
+
|
433 |
+
- **avg_tc**: Average True Contribution (`TC`)
|
434 |
+
- **sharpe_tc**: Sharpe Ratio of True Contribution (`TC`)
|
435 |
+
|
436 |
+
- **avg_2C1T**: Average `2xCORRv2 + 1xTC`
|
437 |
+
- **sharpe_2C1T**: Sharpe Ratio of `2xCORRv2 + 1xTC`
|
438 |
+
|
439 |
+
"),
|
440 |
+
|
441 |
+
br()
|
442 |
+
),
|
443 |
+
|
444 |
+
|
445 |
+
br()
|
446 |
+
|
447 |
+
),
|
448 |
+
|
449 |
|
450 |
tabPanel("Payout (Overview)",
|
451 |
|
|
|
662 |
- #### **0.2.0** — Replaced `Payout Summary` with `Performance Summary`. Added KPIs summary
|
663 |
- #### **0.2.1** — Added `KPI (All)`
|
664 |
- #### **0.2.2** — Sped up chart rendering with `toWebGL()`
|
665 |
+
- #### **0.2.3** — Added new `MMC` - Ref: https://forum.numer.ai/t/changing-scoring-payouts-again-to-mmc-only/6794/27
|
666 |
"),
|
667 |
|
668 |
br(),
|
|
|
681 |
|
682 |
footer = shinydashboardPlus::dashboardFooter(
|
683 |
left = "Powered by ❤️, ☕, Shiny, and 🤗 Spaces",
|
684 |
+
right = paste0("Version 0.2.3"))
|
685 |
|
686 |
)
|
687 |
|
|
|
777 |
) |>
|
778 |
|
779 |
# Reformat individual columns
|
780 |
+
formatRound(columns = c("corrV2", "tc", "fncV3", "corr_meta", "pay_ftr", "mmc"), digits = 4) |>
|
781 |
formatRound(columns = c("apcwnm", "mcwnm"), digits = 4) |>
|
782 |
+
formatRound(columns = c("corrV2_pct", "tc_pct", "fncV3_pct", "mmc_pct"), digits = 1) |>
|
783 |
formatRound(columns = c("stake", "payout"), digits = 2) |>
|
784 |
|
785 |
formatStyle(columns = c("model"),
|
|
|
789 |
fontWeight = "bold",
|
790 |
color = styleInterval(cuts = -1e-15, values = c("#D24141", "#2196F3"))) |>
|
791 |
|
792 |
+
formatStyle(columns = c("corrV2", "fncV3", "mmc"),
|
793 |
color = styleInterval(cuts = -1e-15, values = c("#D24141", "black"))) |>
|
794 |
|
795 |
formatStyle(columns = c("tc"),
|
796 |
color = styleInterval(cuts = -1e-15, values = c("#D24141", "#A278DC"))) |>
|
797 |
|
798 |
+
formatStyle(columns = c("corrV2_pct", "tc_pct", "fncV3_pct", "mmc_pct"),
|
799 |
color = styleInterval(cuts = c(1, 5, 15, 85, 95, 99),
|
800 |
values = c("#692020", "#9A2F2F", "#D24141",
|
801 |
"#D1D1D1", # light grey
|
|
|
1047 |
d_pref[stake >0, rate_of_return := payout / stake * 100]
|
1048 |
|
1049 |
# Extract Raw KPI
|
1050 |
+
if (input$kpi_choice == "MMCv2: The Latest and the Greatest MMC") d_pref[, KPI := mmc]
|
1051 |
if (input$kpi_choice == "CORRv2: CORRelation with target cyrus_v4_20") d_pref[, KPI := corrV2]
|
1052 |
if (input$kpi_choice == "TC: True Contribtuion to the hedge fund's returns") d_pref[, KPI := tc]
|
1053 |
if (input$kpi_choice == "FNCv3: Feature Neutral Correlation with respect to the FNCv3 features") d_pref[, KPI := fncV3]
|
|
|
1536 |
d_kpi <- react_d_kpi()
|
1537 |
|
1538 |
# Dynamic Labels
|
1539 |
+
if (input$kpi_choice == "MMCv2: The Latest and the Greatest MMC") y_label <- "mmc"
|
1540 |
if (input$kpi_choice == "CORRv2: CORRelation with target cyrus_v4_20") y_label <- "CORRv2"
|
1541 |
if (input$kpi_choice == "TC: True Contribtuion to the hedge fund's returns") y_label <- "TC"
|
1542 |
if (input$kpi_choice == "FNCv3: Feature Neutral Correlation with respect to the FNCv3 features") y_label <- "FNCv3"
|