Skip to content

Commit

Permalink
[DOC] Fix typos throughout the codebase (#338)
Browse files Browse the repository at this point in the history
Fixes some misspellings all over the project.

@fkiraly https://github.com/crate-ci/typos
  • Loading branch information
szepeviktor authored May 16, 2024
1 parent dfe15c7 commit 7de4d54
Show file tree
Hide file tree
Showing 28 changed files with 70 additions and 59 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@
"contributions": [
"maintenance"
]
},
{
"login": "szepeviktor",
"name": "Viktor Szépe",
"avatar_url": "https://avatars.githubusercontent.com/u/952007?v=4",
"profile": "https://github.com/szepeviktor",
"contributions": [
"doc"
]
}
]
}
4 changes: 2 additions & 2 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Let's have a look at an example of Boston Housing price prediction (using sklear

If you are familiar with scikit-learn you will recognise that we define and train a model on the boston housing dataset and obtain the test prediction ``y_pred``. Furthermore, we use a loss function to calculate the loss between the predicted points and the true values -- nothing unexpected there.

Crucially, however, the skpro model does not just return a list of numbers or point predictions here. Instead, ``y_pred`` is a probablistic prediction, i.e. it represents probability distributions for each individual data point.
Crucially, however, the skpro model does not just return a list of numbers or point predictions here. Instead, ``y_pred`` is a probabilistic prediction, i.e. it represents probability distributions for each individual data point.
We can, for instance, obtain the standard deviation of the predicted distribution that corresponds with the first (0th) test point (or any other test point distribution) ::

>>> y_pred[0].std()
Expand All @@ -44,7 +44,7 @@ Notably, the interface represents all distributional properties, including the d
>>> y_pred[0].pdf(x=42)
0.00192808538756

Furthermore, it is possible to conveniently access the distributional properties in their vectorized form accross the test sample::
Furthermore, it is possible to conveniently access the distributional properties in their vectorized form across the test sample::

>>> y_pred.std().shape
(152,)
Expand Down
6 changes: 4 additions & 2 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog
=========

All notable changes to this project beggining with version 0.1.0 will be
All notable changes to this project beginning with version 0.1.0 will be
documented in this file. The format is based on
`Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_ and we adhere
to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_. The source
Expand Down Expand Up @@ -197,6 +197,7 @@ Documentation
* [DOC] tutorial notebook for survival prediction (:pr:`305`) :user:`fkiraly`
* [DOC] visualizations for first intro vignette in intro notebook and minor updates (:pr:`311`) :user:`fkiraly`
* [DOC] improve docstrings of metrics (:pr:`317`) :user:`fkiraly`
* [DOC] Fix typos throughout the codebase (:pr:`338`) :user:`szepeviktor`

Contributors
~~~~~~~~~~~~
Expand All @@ -207,7 +208,8 @@ Contributors
:user:`nilesh05apr`,
:user:`setoguchi-naoki`,
:user:`ShreeshaM07`,
:user:`sukjingitsit`
:user:`sukjingitsit`,
:user:`szepeviktor`


[2.2.2] - 2024-04-20
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def find_source():
nbsphinx_allow_errors = False # False
nbsphinx_timeout = 600 # seconds, set to -1 to disable timeout

# add Binder launch buttom at the top
# add Binder launch button at the top
current_file = "{{ env.doc2path( env.docname, base=None) }}"

# make sure Binder points to latest stable release, not main
Expand Down
4 changes: 2 additions & 2 deletions docs/source/contribute/code_of_conduct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Code of conduct
===============

The ``skpro`` project believes that everyone should be able to participate
in our community without fear of harrassment or discrimination. All contributors
in our community without fear of harassment or discrimination. All contributors
are expected to show respect and courtesy to other members of the community
at all times.

Expand All @@ -22,4 +22,4 @@ to Dr. Franz Király by email at franz.kiraly@sktime.net.
Code of Conduct processes (including how to report incidents).
This may change as the project matures.
However, ``skpro``'s Code of Conduct will remain
dedicated to promoting a community without harrassment and discrimination.
dedicated to promoting a community without harassment and discrimination.
2 changes: 1 addition & 1 deletion docs/source/developer_guide/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Types of dependencies

Making it easy to install and use ``skpro`` in a variety of projects is
on of ``skpro``'s goals. Therefore, we seeks to minimizing the number of
dependencies needed to provide the proejct's functionality.
dependencies needed to provide the project's functionality.

Soft Dependencies
=================
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developer_guide/deprecation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The release manager process happens at every release and is as follows:
Special deprecations
====================

This section outlines the deprecation process for some advaned cases.
This section outlines the deprecation process for some advanced cases.

Deprecating tags
----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developer_guide/reviewer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Code Review

.. _reviewer_guide_doc:

Documenation Review
Documentation Review
====================

* Are the docstrings complete and understandable to users?
Expand Down
10 changes: 5 additions & 5 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ To install the latest development version of ``skpro``, the sequence
of steps is as follows:


1. Clone the ``skpro`` `Github repository`_
1. Clone the ``skpro`` `GitHub repository`_
2. Create a new virtual environment via ``conda`` and activate it.
3. Use ``pip`` to build ``skpro`` from source and install development dependencies


Detail instructions for each step is provided below.

Step 1 - Clone Github repository
Step 1 - Clone GitHub repository
--------------------------------

The ``skpro`` `Github repository`_ should be cloned to a local directory.
The ``skpro`` `GitHub repository`_ should be cloned to a local directory.

To install the latest version using the ``git`` command line, use the following steps:

Expand All @@ -97,7 +97,7 @@ To install the latest version using the ``git`` command line, use the following
4. Make sure you are on the main branch: :code:`git checkout main`
5. Make sure your local version is up-to-date: :code:`git pull`

See Github's `repository clone documentation`_
See GitHub's `repository clone documentation`_
for additional details.

.. hint::
Expand All @@ -108,7 +108,7 @@ for additional details.
Where ``<VERSION>`` is a valid version string that can be found by inspecting the
repository's ``git`` tags, by running ``git tag``.

You can also download a specific release version from the Github repository's
You can also download a specific release version from the GitHub repository's
zip archive of `releases <https://github.com/sktime/skpro/releases>`_.

Step 2 - Create a new virtual environment
Expand Down
8 changes: 4 additions & 4 deletions examples/01_skpro_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,7 @@
" <td>capability:survival</td>\n",
" <td>regressor_proba</td>\n",
" <td>bool</td>\n",
" <td>whether estimator can use censoring informatio...</td>\n",
" <td>whether estimator can use censoring information...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
Expand All @@ -2514,7 +2514,7 @@
"1 which machine type(s) is the internal _fit/_pr... \n",
"2 whether estimator supports missing values \n",
"3 whether estimator supports multioutput regression \n",
"4 whether estimator can use censoring informatio... \n",
"4 whether estimator can use censoring information... \n",
"5 which machine type(s) is the internal _fit/_pr... "
]
},
Expand Down Expand Up @@ -4423,7 +4423,7 @@
"* predicting variance equal to training residual variance - `ResidualDouble` with standard settings\n",
" * or other unconditional distribution estimate for residuals\n",
"* \"squaring the residual\" two-step prediction - `ResidualDouble`\n",
"* boostrap prediction intervals - `BootstrapRegressor`\n",
"* bootstrap prediction intervals - `BootstrapRegressor`\n",
"* MAPIE model agnostic prediction intervals - `MapieRegressor` (from `mapie` package)\n",
"* natural gradient boosting aka NGBoost - `NGBoostRegressor` (from `ngboost` package)"
]
Expand Down Expand Up @@ -5095,7 +5095,7 @@
"1. Read through the [probabilistic regression extension template](https://github.com/sktime/skpro/blob/main/extension_templates/regression.py) - this is a `python` file with `todo` blocks that mark the places in which changes need to be added.\n",
"2. Copy the proba regressor extension template to a local folder in your own repository (local/private extension), or to a suitable location in your clone of the `skpro` or affiliated repository (if contributed extension), inside `skpro.regression`; rename the file and update the file docstring appropriately.\n",
"3. Address the \"todo\" parts. Usually, this means: changing the name of the class, setting the tag values, specifying hyper-parameters, filling in `__init__`, `_fit`, and at least one of the probabilistic prediction methods, preferably `_predict_proba` (for details see the extension template). You can add private methods as long as they do not override the default public interface. For more details, see the extension template.\n",
"4. To test your estimator manually: import your estimator and run it in the worfklows in Section 1; then use it in the compositors in Section 3.\n",
"4. To test your estimator manually: import your estimator and run it in the workflows in Section 1; then use it in the compositors in Section 3.\n",
"5. To test your estimator automatically: call `skpro.utils.check_estimator` on your estimator. You can call this on a class or object instance. Ensure you have specified test parameters in the `get_test_params` method, according to the extension template.\n",
"\n",
"In case of direct contribution to `skpro` or one of its affiliated packages, additionally:\n",
Expand Down
16 changes: 8 additions & 8 deletions examples/02_skpro_survival.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"source": [
"`skpro` provides a unified interface to time-to-event prediction models, also known as survival prediction models.\n",
"\n",
"**Time-to-event prediction** is a form of probabilistic regression where **labels can be \"censored\"**, i.e., of the form \"time is t or later\" instead of exat observations.\n",
"**Time-to-event prediction** is a form of probabilistic regression where **labels can be \"censored\"**, i.e., of the form \"time is t or later\" instead of exact observations.\n",
"\n",
"**Section 1** provides an overview of the basic **time-to-event prediction workflows** supported by `skpro`.\n",
"\n",
Expand Down Expand Up @@ -103,7 +103,7 @@
"metadata": {},
"outputs": [],
"source": [
"# simulated toy datset, lung cancer survival times\n",
"# simulated toy dataset, lung cancer survival times\n",
"import numpy as np\n",
"\n",
"# demographics - age and smoker yes/no\n",
Expand Down Expand Up @@ -567,7 +567,7 @@
}
],
"source": [
"# plotting survival funtions in one figure, smokers in red\n",
"# plotting survival functions in one figure, smokers in red\n",
"from matplotlib.pyplot import subplots\n",
"\n",
"_, ax = subplots()\n",
Expand Down Expand Up @@ -636,7 +636,7 @@
}
],
"source": [
"# plotting survival funtions in one figure, smokers in red\n",
"# plotting survival functions in one figure, smokers in red\n",
"from matplotlib.pyplot import subplots\n",
"\n",
"_, ax = subplots()\n",
Expand Down Expand Up @@ -705,7 +705,7 @@
}
],
"source": [
"# plotting survival funtions in one figure, smokers in red\n",
"# plotting survival functions in one figure, smokers in red\n",
"from matplotlib.pyplot import subplots\n",
"\n",
"_, ax = subplots()\n",
Expand Down Expand Up @@ -954,7 +954,7 @@
"* metrics will compare probabilistic prediction to tabular ground truth and\n",
" censoring indicator\n",
"* the metric needs to be of a compatible type, e.g., for distribution predictions\n",
"* special survival metrics are avaliable to take into account censoring;\n",
"* special survival metrics are available to take into account censoring;\n",
" if a non-survival metric is used, the censoring indicator will be ignored"
]
},
Expand Down Expand Up @@ -1296,7 +1296,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"the three main reduction stratgies to create survival regressors:\n",
"the three main reduction strategies to create survival regressors:\n",
"\n",
"1. adding the capability to handle censoring information to a probabilistic supervised regressor\n",
"2. the above, combined with any strategy to create a probabilistic regressor from an `sklearn` (non-probabilistic) regressors\n",
Expand Down Expand Up @@ -1757,7 +1757,7 @@
"1. Read through the [survival regression extension template](https://github.com/sktime/skpro/blob/main/extension_templates/survival.py) - this is a `python` file with `todo` blocks that mark the places in which changes need to be added.\n",
"2. Copy the proba regressor extension template to a local folder in your own repository (local/private extension), or to a suitable location in your clone of the `skpro` or affiliated repository (if contributed extension), inside `skpro.survival`; rename the file and update the file docstring appropriately.\n",
"3. Address the \"todo\" parts. Usually, this means: changing the name of the class, setting the tag values, specifying hyper-parameters, filling in `__init__`, `_fit`, and at least one of the probabilistic prediction methods, preferably `_predict_proba` (for details see the extension template). You can add private methods as long as they do not override the default public interface. For more details, see the extension template.\n",
"4. To test your estimator manually: import your estimator and run it in the worfklows in Section 1; then use it in the compositors in Section 3.\n",
"4. To test your estimator manually: import your estimator and run it in the workflows in Section 1; then use it in the compositors in Section 3.\n",
"5. To test your estimator automatically: call `skpro.utils.check_estimator` on your estimator. You can call this on a class or object instance. Ensure you have specified test parameters in the `get_test_params` method, according to the extension template.\n",
"\n",
"In case of direct contribution to `skpro` or one of its affiliated packages, additionally:\n",
Expand Down
16 changes: 8 additions & 8 deletions examples/03_skpro_distributions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"at construction, all (simple) probabilty distributions broadcast parameters:\n",
"at construction, all (simple) probability distributions broadcast parameters:\n",
"\n",
"* if `index` or `columns` are passed, always broadcasts to 2D\n",
"* 1D iterables are interpreted as row vectors, i.e., of shape (1, n)\n",
Expand Down Expand Up @@ -1375,7 +1375,7 @@
"\n",
"n = Normal(mu=[[1, 2], [2, 3]], sigma=2)\n",
"# results in a shape (2, 2) distribution\n",
"# sigma is broadcast ot the shape of mu\n",
"# sigma is broadcast to the shape of mu\n",
"# index, columns are RangeIndex, i.e., [0, 1]\n",
"n.shape"
]
Expand Down Expand Up @@ -1463,7 +1463,7 @@
"n = Normal(mu=[1, 2, 3], sigma=2)\n",
"# results in a shape (1, 3) distribution\n",
"# mu is interpreted as (1, 3) row vector\n",
"# sigma is broadcast ot the shape of mu\n",
"# sigma is broadcast to the shape of mu\n",
"# index, columns are RangeIndex, i.e., index=[0] and columns=[0, 1, 2]\n",
"n.shape"
]
Expand Down Expand Up @@ -1537,7 +1537,7 @@
"source": [
"as first-class citizens, all objects in `skpro` are indexed via the `registry` utility `all_objects`.\n",
"\n",
"To find probabilisty distirbutions, use `all_objects` with the type `distribution`:"
"To find probabilisty distributions, use `all_objects` with the type `distribution`:"
]
},
{
Expand Down Expand Up @@ -2447,7 +2447,7 @@
],
"source": [
"# dataframe distributions convert to a DataFrame\n",
"# with column MultiIndex (variable, parmaeter)\n",
"# with column MultiIndex (variable, parameter)\n",
"d = Normal(mu=[[1, 2], [3, 4], [5, 6]], sigma=2, columns=[\"var1\", \"var2\"])\n",
"d.to_df()"
]
Expand Down Expand Up @@ -2648,10 +2648,10 @@
"* Follow the [\"implementing estimator\" developer guide](https://skpro.readthedocs.io/en/stable/developer_guide/add_estimators.html)\n",
"* Use the [probabilistic regressor template](https://github.com/sktime/skpro/blob/main/extension_templates/regression.py) to get started\n",
"\n",
"1. Read through the [probability distibution extension template](https://github.com/sktime/skpro/blob/main/extension_templates/distributions.py) - this is a `python` file with `todo` blocks that mark the places in which changes need to be added.\n",
"1. Read through the [probability distribution extension template](https://github.com/sktime/skpro/blob/main/extension_templates/distributions.py) - this is a `python` file with `todo` blocks that mark the places in which changes need to be added.\n",
"2. Copy the distribution extension template to a local folder in your own repository (local/private extension), or to a suitable location in your clone of the `skpro` or affiliated repository (if contributed extension), inside `skpro.distributions`; rename the file and update the file docstring appropriately.\n",
"3. Address the \"todo\" parts. Usually, this means: changing the name of the class, setting the tag values, specifying hyper-parameters, filling in `__init__`, and as many methods as possible, most importantly `_ppf`, and possibly other common methods such as `_pdf` or `_pmf`, `_cdf`. You can add private methods as long as they do not override the default public interface. For more details, see the extension template.\n",
"4. To test your estimator manually: import your estimator and run it in the worfklows in Section 1; then use it in the compositors in Section 3.\n",
"4. To test your estimator manually: import your estimator and run it in the workflows in Section 1; then use it in the compositors in Section 3.\n",
"5. To test your estimator automatically: call `skpro.utils.check_estimator` on your estimator. You can call this on a class or object instance. Ensure you have specified test parameters in the `get_test_params` method, according to the extension template.\n",
"\n",
"In case of direct contribution to `skpro` or one of its affiliated packages, additionally:\n",
Expand All @@ -2670,7 +2670,7 @@
"\n",
"* `skpro` provides a unified interface for probability distributions, with an interface inspired by `scikit-learn` and `pandas`\n",
"\n",
"* `skpro` distributions are parametric first class objects. They are symbolic representations of probability distibution, and come with methods such as `pdf`, `cdf`, `sample`, `plot`, etc\n",
"* `skpro` distributions are parametric first class objects. They are symbolic representations of probability distribution, and come with methods such as `pdf`, `cdf`, `sample`, `plot`, etc\n",
"\n",
"* `skpro` distributions can be scalar-valued, or data frame valued. The latter broadcast parameters and arguments of methods to 2D, and are returned by `skpro` probabilistic regressors or survival regressors `predict_proba`\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion extension_templates/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ClassName(BaseProbaRegressor):
# parameter checks can go after super call
def __init__(self, paramname, paramname2="paramname2default"):
# estimators should precede parameters
# if estimators have default values, set None and initalize below
# if estimators have default values, set None and initialize below

# todo: write any hyper-parameters and components to self
self.paramname = paramname
Expand Down
2 changes: 1 addition & 1 deletion extension_templates/survival.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ClassName(BaseSurvReg):
# parameter checks can go after super call
def __init__(self, paramname, paramname2="paramname2default"):
# estimators should precede parameters
# if estimators have default values, set None and initalize below
# if estimators have default values, set None and initialize below

# todo: write any hyper-parameters and components to self
self.paramname = paramname
Expand Down
Loading

0 comments on commit 7de4d54

Please sign in to comment.