Closed nikosGeography closed 4 months ago
Hi @nikosGeography, from your output above you have responses $Y_i$ and predictions $\hat Y_i$ (preds.llf
) that you can plug into the rsquare formula (or any other favorite error metric). If you further along the line are doing causal effect estimation and want an area-under-the-curve metric, you could check out the RATE.
I found a solution which calculates the correlation between the predicted and the target variable and squares the results. Something like r_squared <- (cor(preds.llf, target_variable)^2)
.
Great package, I have recently discovered the local linear forest (LLF) and I am impressed. Keep up the good work. I'd like to ask how can I compute the R2 (r-squared) of an LLF regression model. Given the example below:
How can I calculate the R2? If this question has already been answered, feel free to close it but please point me to the answer. I searched on the Closed questions but either it hasn't been answered yet or I missed it.
R 4.3.2, RStudio 2023.12.1 Build 402, Windows 11.