R/customMetrics.R
pearson_correlation_coefficient.Rd
Function for Pearson correlation coefficient.
pearson_correlation_coefficient(y_true, y_pred)
y_true | True labels (Tensor) |
---|---|
y_pred | Predictions (Tensor of the same shape as |
Correlation
Tustison NJ
#> Error in py_discover_config(required_module, use_environment): Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not existmetric_pearson_correlation_coefficient <- custom_metric( "pearson_correlation_coefficient", pearson_correlation_coefficient )#> Error in value[[3L]](cond): The R function's signature must not contains esoteric Python-incompatible constructs. Detailed traceback: #> Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not existmodel %>% compile( loss = loss_categorical_crossentropy, optimizer = optimizer_adam( lr = 0.0001 ), metrics = c( metric_pearson_correlation_coefficient ) )#> Error in compile(., loss = loss_categorical_crossentropy, optimizer = optimizer_adam(lr = 1e-04), metrics = c(metric_pearson_correlation_coefficient)): object 'model' not found