powered by
A function to return R^2 metrics for predictions vs actual values. Works well when piped to straight from get_predictions().
get_r_squared(predictions, biomarker_values, model = "", threshold = 10)
(list) A list with two elements, 'predictions' and 'panel_lengths', as produced by the function get_predictions().
(dataframe) A dataframe with two columns, 'Tumor_Sample_Barcode' and a column with the name of the biomarker in question containing values.
(character) The name of the model type producing these predictions.
(numeric) Unusued in this function: present for calls to get_stats().
A dataframe with 5 columns:
panel_length: the length of each panel.
model: the model that produced the predictions.
biomarker: the name of the biomarker in question.
stat: the R squared values for each panel.
metric: a constant character "R" for R squared.
# NOT RUN { example_r <- get_r_squared(predictions = get_predictions(example_refit_panel, new_data = example_tables$val), biomarker_values = example_tmb_tables$val, model = "Refitted T") # }
Run the code above in your browser using DataLab