Fit a simple Funding Opportunity Model (logistic)
Source:R/analysis_fit_opportunity_model.R
analysis_fit_opportunity_model.RdFits a logistic regression to predict whether a donor will fund a recipient
in year t+1 based on features prepared by prepare_opportunity_dataset().
Usage
analysis_fit_opportunity_model(
features,
min_year = NULL,
donor_name = NULL,
recipient_name = NULL
)Arguments
- features
Dataframe produced by
analysis_prepare_opportunity_dataset().- min_year
Minimum year to use for training (filters older data).
- donor_name
Optional donor name to highlight in the plot.
- recipient_name
Optional recipient name to highlight in the plot.
Examples
features <- analysis_prepare_opportunity_dataset(flows)$data
model_results <- analysis_fit_opportunity_model(features, min_year = NULL, donor_name = "Germany")
print(model_results$plot)