evaluate_single_importances_ligand_prediction: Evaluation of ligand activity prediction performance of...

View source: R/evaluate_model_ligand_prediction.R

evaluate_single_importances_ligand_predictionR Documentation

Evaluation of ligand activity prediction performance of single ligand importance scores: aggregate all datasets.

Description

evaluate_single_importances_ligand_prediction Evaluate how well a single ligand importance score is able to predict the true activity state of a ligand. For this it is assumed, that ligand importance measures for truely active ligands will be higher than for non-active ligands. Several classification evaluation metrics for the prediction are calculated and variable importance scores can be extracted to rank the different importance measures in order of importance for ligand activity state prediction.

Usage

evaluate_single_importances_ligand_prediction(importances,normalization)

Arguments

importances

A data frame containing at least folowing variables: $setting, $test_ligand, $ligand and one or more feature importance scores. $test_ligand denotes the name of a possibly active ligand, $ligand the name of the truely active ligand.

normalization

Way of normalization of the importance measures: "mean" (classifcal z-score) or "median" (modified z-score) or "no" (use unnormalized feature importance scores - only recommended when evaluating ligand activity prediction on individual datasets)

Value

A data frame containing classification evaluation measures for the ligand activity state prediction single, individual feature importance measures.

Examples

## Not run: 
settings = lapply(expression_settings_validation[1:5],convert_expression_settings_evaluation)
settings_ligand_pred = convert_settings_ligand_prediction(settings, all_ligands = unlist(extract_ligands_from_settings(settings,combination = FALSE)), validation = TRUE, single = TRUE)

weighted_networks = construct_weighted_networks(lr_network, sig_network, gr_network, source_weights_df)
ligands = extract_ligands_from_settings(settings_ligand_pred,combination = FALSE)
ligand_target_matrix = construct_ligand_target_matrix(weighted_networks, ligands)
ligand_importances = dplyr::bind_rows(lapply(settings_ligand_pred,get_single_ligand_importances,ligand_target_matrix))
evaluation = evaluate_single_importances_ligand_prediction(ligand_importances,normalization = "median")
print(head(evaluation))

## End(Not run)

saeyslab/nichenetr documentation built on March 26, 2024, 9:22 a.m.