diff --git a/README.md b/README.md index 202546a..4901365 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,11 @@ at one place. Currently only 1-dimensional data is supported. ## How to Install -using `pip` +You can install SeqMetrics using `pip` pip install SeqMetrics -or using github link for the latest code +or using GitHub link for the latest code python -m pip install git+https://github.com/AtrCheema/SeqMetrics.git @@ -49,7 +49,7 @@ er.nse() # calculate Nash Sutcliff efficiency er.calculate_all(verbose=True) # or calculate errors using all available methods ``` -We can visualize the calcuated performance metrics if we have [easy_mpl]() package installed. +We can visualize the calcuated performance metrics if we have [easy_mpl](https://easy-mpl.readthedocs.io) package installed. ```python import numpy as np from SeqMetrics import RegressionMetrics, plot_metrics @@ -62,12 +62,19 @@ er = RegressionMetrics(true, pred) plot_metrics(er.calculate_all(), color="Blues") ``` -# ![MLP based model](docs/source/imgs/reg1.png "Title") -# ![MLP based model](docs/source/imgs/reg2.png "Title") -# ![MLP based model](docs/source/imgs/reg3.png "Title") -# ![MLP based model](docs/source/imgs/reg4.png "Title") -Currently following regression performance metrics are being calculated. +

+ + +

+ +

+ + +

+ + +`RegressionMetrics` currently, calculates following performane metrics for regression. | Name | Name in this repository | | -------------------------- | ------------- | diff --git a/SeqMetrics/utils.py b/SeqMetrics/utils.py index ae51aad..9e7a02e 100644 --- a/SeqMetrics/utils.py +++ b/SeqMetrics/utils.py @@ -33,18 +33,19 @@ def plot_metrics( show: bool = True, save: bool = False, save_path: str = '', - **kwargs): + **kwargs +)->None: """ Plots the metrics given as dictionary as radial or bar plot between specified ranges. Arguments: - metrics: + metrics : dict dictionary whose keys are names are erros and values are error values. - ranges: + ranges : tuple of tuples defining range of errors to plot in one plot - exclude: + exclude : list List of metrics to be excluded from plotting. - max_metrics_per_fig: + max_metrics_per_fig : int maximum number of metrics to show in one figure. plot_type: either of ``radial`` or ``bar``. @@ -56,6 +57,9 @@ def plot_metrics( kwargs: keyword arguments for plotting + Retuns: + None + Examples: >>> import numpy as np >>> from SeqMetrics import RegressionMetrics @@ -67,7 +71,7 @@ def plot_metrics( >>> plot_metrics(all_errors, plot_type='bar', max_metrics_per_fig=50) >>> # or draw the radial plot >>> plot_metrics(all_errors, plot_type='radial', max_metrics_per_fig=50) - ``` + """ for idx, rng in enumerate(ranges): assert rng[1] > rng[0], f'For range {idx}, second value: {rng[1]} is not greater than first value: {rng[0]}. ' diff --git a/docs/source/conf.py b/docs/source/conf.py index 3e5b8a0..8a5b739 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -57,6 +57,12 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] +# intersphinx configuration +intersphinx_mapping = { + 'python': ('https://docs.python.org/{.major}'.format( + sys.version_info), None), + 'numpy': ('https://docs.scipy.org/doc/numpy/', None), +} # -- Options for HTML output ------------------------------------------------- diff --git a/docs/source/utils.rst b/docs/source/utils.rst index 125a523..1462e3d 100644 --- a/docs/source/utils.rst +++ b/docs/source/utils.rst @@ -2,13 +2,8 @@ utility functions ***************** - - Utils ======== .. autoclass:: SeqMetrics.utils.plot_metrics :members: :undoc-members: - :show-inheritance: - - .. automethod:: __init__