Displaying 4 results from an estimated 4 matches for "postresampl".
Did you mean:
postresample
2007 Dec 11
1
postResample R² and lm() R²
Hello,
I'm with a conceptual doubt regarding Rsquared of both lm() and
postResample(library caret).
I've got a multiple regression linear model (lets say mlr) with anR² value
of 67.52%.
Then I use this model pro make predictions with predict() function using the
same data as input , that is, use the generated model to predict the value
associated with data that I used as inp...
2023 May 09
1
RandomForest tuning the parameters
...result['y'] = y_test
> > result['prediction'] = predictions
> > result
> >
> > # Import library for Metrics
> > library(Metrics)
> >
> > print(paste0('MAE: ' , mae(y_test,predictions) ))
> > print(paste0('MSE: ' ,caret::postResample(predictions ,
> y_test)['RMSE']^2 ))
> > print(paste0('R2: ' ,caret::postResample(predictions ,
> y_test)['Rsquared'] ))
> >
> >
> > #Tuning the parameters
> > N=500 #length(X_train)
> > X_train_ = X_train[1:N , ]
> > y_train_...
2023 May 08
1
RandomForest tuning the parameters
...regr
?
#Make prediction
predictions= predict(regr, X_test)
?
result= X_test
result['y'] = y_test
result['prediction'] = predictions
result
?
# Import library for Metrics
library(Metrics)
?
print(paste0('MAE: ' , mae(y_test,predictions) ))
print(paste0('MSE: ' ,caret::postResample(predictions , y_test)['RMSE']^2 ))
print(paste0('R2: ' ,caret::postResample(predictions , y_test)['Rsquared'] ))
?
#Tuning the parameters
N=500 #length(X_train)
X_train_ = X_train[1:N , ]
y_train_ = y_train[1:N]
seed <-7
metric<-'RMSE'
customRF <- list(t...
2007 Dec 08
1
lm: how to calculate rsquared of the predicted values?
Hi,
I've built a linear model using multiple linear regression which leads me a
R-squared value of 73.58%.
After that, I used this model to predicted some values based on the test
data.
Now I'm wondering how:
1. can I measure de R-squared value between the predicted(by the model) and
real (observed) values.?
2. Measure the RMSE error .
Example: suppose my data its below:
REAL