Skip to content

Commit

Permalink
Slightly modify the tutorial so that the help message is not shown by…
Browse files Browse the repository at this point in the history
… default,

but it is easy to access if wanted
  • Loading branch information
tennlee committed Jan 18, 2024
1 parent 6e400ae commit 169fb50
Showing 1 changed file with 5 additions and 51 deletions.
56 changes: 5 additions & 51 deletions tutorials/Mean_Absolute_Error.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,18 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 1,
"id": "cf78b685-ec20-4935-848f-333fc7fc6735",
"metadata": {
"scrolled": true,
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on function mae in module scores.continuous.standard_impl:\n",
"\n",
"mae(fcst: Union[xarray.core.dataarray.DataArray, xarray.core.dataset.Dataset, pandas.core.series.Series], obs: Union[xarray.core.dataarray.DataArray, xarray.core.dataset.Dataset, pandas.core.series.Series], reduce_dims: Optional[collections.abc.Iterable[collections.abc.Hashable]] = None, preserve_dims: Optional[collections.abc.Iterable[collections.abc.Hashable]] = None, weights: xarray.core.dataarray.DataArray = None, angular: bool = False) -> Union[xarray.core.dataarray.DataArray, xarray.core.dataset.Dataset, pandas.core.series.Series]\n",
" Calculates the mean absolute error from forecast and observed data.\n",
" \n",
" A detailed explanation is on [Wikipedia](https://en.wikipedia.org/wiki/Mean_absolute_error)\n",
" \n",
" Dimensional reduction is not supported for pandas and the user should\n",
" convert their data to xarray to formulate the call to the metric.\n",
" At most one of reduce_dims and preserve_dims may be specified.\n",
" Specifying both will result in an exception.\n",
" \n",
" Args:\n",
" fcst: Forecast or predicted variables in xarray or pandas.\n",
" obs: Observed variables in xarray or pandas.\n",
" reduce_dims: Optionally specify which dimensions to reduce when\n",
" calculating MAE. All other dimensions will be preserved.\n",
" preserve_dims: Optionally specify which dimensions to preserve when\n",
" calculating MAE. All other dimensions will be reduced. As a\n",
" special case, 'all' will allow all dimensions to be preserved. In\n",
" this case, the result will be in the same shape/dimensionality\n",
" as the forecast, and the errors will be the absolute error at each\n",
" point (i.e. single-value comparison against observed), and the\n",
" forecast and observed dimensions must match precisely.\n",
" weights: Optionally provide an array for weighted averaging (e.g. by area, by latitude,\n",
" by population, custom)\n",
" angular: specifies whether `fcst` and `obs` are angular\n",
" data (e.g. wind direction). If True, a different function is used\n",
" to calculate the difference between `fcst` and `obs`, which\n",
" accounts for circularity. Angular `fcst` and `obs` data should be in\n",
" degrees rather than radians.\n",
" \n",
" Returns:\n",
" By default an xarray DataArray containing\n",
" a single floating point number representing the mean absolute error for the\n",
" supplied data. All dimensions will be reduced.\n",
" \n",
" Alternatively, an xarray structure with dimensions preserved as appropriate\n",
" containing the score along reduced dimensions\n",
"\n"
]
}
],
"outputs": [],
"source": [
"from scores.continuous import mae\n",
"\n",
"help(mae)"
"# Uncomment the line below to view detailed help information on the arguments to the MAE function\n",
"# help(mae)"
]
},
{
Expand Down Expand Up @@ -956,7 +910,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 169fb50

Please sign in to comment.