Jack-H-Buckner / UniversalDiffEq.jl

Universal differential equations for ecologists
MIT License
5 stars 0 forks source link

Change function names to be more intuitive #32

Closed zechmeunier closed 3 months ago

zechmeunier commented 4 months ago

There are a handful of function names with similar names:

It isn't obvious when to use which function. To make the functions more user-friendly, I suggest changing the names to include the intended outputs. For example, plot_predictions produces a scatterplot of observed change vs. predicted change, so it could be renamed plot_obs_preds_fit. Similarly, predictions yields a vector while predict uses the same function to produce a data frame. So these could be renamed predict_vector or predict_tuple or predict_df depending on the output type.

Is there a distinction between prediction and forecast currently? We could use predict/prediction specifically for in-sample data (i.e., within the timeframe of available data) and forecast for out-of-sample future data (i.e., beyond the timeframe of available data).

Also, would there be any need for a hindcast function (i.e., before the timeframe of available data)?

jarroyoe commented 3 months ago

Hey Zech, I think you're the best person to take a look into this from an UX perspective so please take a look into this.

predict and predictions are equivalent functions that return the predicted points of the training data by the neural network, and if new data is provided, then the function returns the predicted values by the neural network. This is the same behavior of the predict function in R. I would advocate to keep the syntax similar to R and deprecate predictions so there is a single function.

forecast extrapolates the neural network to create predictions starting from an initial point. The intention of the function is to forecast starting from the last point of the training data, but right now the code is set up to be more flexible than that. The intended experience can be obtained by setting up the initial point to be the last point of the training data by default.

plot_predictions and plot_forecast are easy ways to plot the outputs of predictions and forecast. Again, plot_predictions could be renamed to plot_predict.

zechmeunier commented 3 months ago

I agree with the deprecation of predictions. Maybe we can modify predict to add an argument for the type of output desired (e.g., data frame, vector, array).

I think plot_predictions and plot_forecast are fine names, we'll just need to document their different usages well.

jarroyoe commented 3 months ago

Solved on commit https://github.com/Jack-H-Buckner/UniversalDiffEq.jl/commit/c3b314e896180a1daee1f5d7cd9f440780be4d6d