diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9189fd7a..8010f82f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ When submitting code, please make every effort to follow existing conventions an Where appropriate, please provide unit tests or integration tests. Unit tests should be pytest based tests and be added to /tests. -Please make sure all tests pass before submitting a pull request. It is also good if you squash your commits and add the tags #major or #minor to the pull request title if need be, otherwise your pull request will be considered a patch bump. Please check [https://semver.org/](https://semver.org/) for more information about versioning. +Please make sure all tests pass before submitting a pull request. It is also good if you squash your commits and add the tags #major or #minor to the pull request title if need be; otherwise, your pull request will be considered a patch bump. Please check [https://semver.org/](https://semver.org/) for more information about versioning. ## Testing the code locally diff --git a/README.md b/README.md index a2014a58..69f55796 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ HiClass is an open-source Python library for hierarchical classification compati - [Who is using HiClass?](#who-is-using-hiclass) - [Install](#install) - [Quick start](#quick-start) -- [Step-by-step walk-through](#step-by-step-walk-through) +- [Step-by-step walkthrough](#step-by-step-walkthrough) - [API documentation](#api-documentation) - [FAQ](#faq) - [Support](#support) @@ -197,9 +197,9 @@ pipeline.fit(X_train, Y_train) predictions = pipeline.predict(X_test) ``` -## Step-by-step walk-through +## Step-by-step walkthrough -A step-by-step walk-through is available on our documentation hosted on [Read the Docs](https://hiclass.readthedocs.io/en/latest/index.html). +A step-by-step walkthrough is available on our documentation hosted on [Read the Docs](https://hiclass.readthedocs.io/en/latest/index.html). This will guide you through the process of installing hiclass within a virtual environment, training, predicting, persisting models and much more. @@ -207,7 +207,7 @@ This will guide you through the process of installing hiclass within a virtual e Here's our official API documentation, available on [Read the Docs](https://hiclass.readthedocs.io/en/latest/api/index.html). -If you notice any issues with the documentation or walk-through, please let us know by opening an issue here: [https://github.com/scikit-learn-contrib/hiclass/issues](https://github.com/scikit-learn-contrib/hiclass/issues). +If you notice any issues with the documentation or walkthrough, please let us know by opening an issue here: [https://github.com/scikit-learn-contrib/hiclass/issues](https://github.com/scikit-learn-contrib/hiclass/issues). ## FAQ @@ -217,9 +217,9 @@ A detailed description on how the classifiers work is available at the [Algorith ## Support -If you run into any problems or issues, please create a [Github issue](https://github.com/scikit-learn-contrib/hiclass/issues) and we'll try our best to help. +If you run into any problems or issues, please create a [GitHub issue](https://github.com/scikit-learn-contrib/hiclass/issues) and we'll try our best to help. -We strive to provide good support through our issue tracker on Github. However, if you'd like to receive private support with: +We strive to provide good support through our issue tracker on GitHub. However, if you'd like to receive private support with: - Phone / video calls to discuss your specific use case and get recommendations - Private discussions over Slack or Mattermost @@ -234,7 +234,7 @@ You can contribute in multiple ways, e.g., reporting bugs, writing or translatin ## Getting the latest updates -If you'd like to get updates when we release new versions, please click on the "Watch" button on the top and select "Releases only". Github will then send you notifications along with a changelog with each new release. +If you'd like to get updates when we release new versions, please click on the "Watch" button on the top and select "Releases only". GitHub will then send you notifications along with a changelog with each new release. ## Citation diff --git a/benchmarks/consumer_complaints/README.md b/benchmarks/consumer_complaints/README.md index f82e9850..ec44edb5 100644 --- a/benchmarks/consumer_complaints/README.md +++ b/benchmarks/consumer_complaints/README.md @@ -107,7 +107,7 @@ Regarding the parameters for Snakemake, they have the following meanings: - `--reason` makes Snakemake print the reason for each executed rule; - `--use-conda` is necessary to indicate that conda will be used to manage the software dependencies of the pipeline; - `--cores` tells Snakemake how many cpus can be used overall (the more cpus you can spare, the faster the pipeline will finish). For a cluster execution, 12 cores is more than enough since individual jobs will have more CPUs allocated later; -- `--resources mem_gb` specifies the total ammount of RAM that should be allocated for all jobs (only used during tuning and training); +- `--resources mem_gb` specifies the total amount of RAM that should be allocated for all jobs (only used during tuning and training); - `--restart-times` defines how many times the pipeline should restart a job if it fails. This could be useful if the reason for failing is out of memory, since each retry will allocate more memory for the failed job; - `--jobs` the number of jobs that can be submitted simultaneously; - `--cluster` the parameters for individual jobs can be set inside the quotation marks. diff --git a/docs/examples/plot_pipeline.py b/docs/examples/plot_pipeline.py index de6a573d..ebebfb3c 100644 --- a/docs/examples/plot_pipeline.py +++ b/docs/examples/plot_pipeline.py @@ -5,7 +5,7 @@ ===================== HiClass can be adopted in scikit-learn pipelines, and fully supports sparse matrices as input. -This example desmonstrates the use of both of these features. +This example demonstrates the use of both of these features. """ from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer diff --git a/docs/source/introduction/what.rst b/docs/source/introduction/what.rst index b7b60a00..290ce2a3 100644 --- a/docs/source/introduction/what.rst +++ b/docs/source/introduction/what.rst @@ -6,4 +6,4 @@ It mirrors the popular API from scikit-learn to train and predict with the most Implemented models include the local classifiers per node, per parent node and per level. HiClass is released under the simplified `BSD 3-Clause license `_. -For the source code, please take a look at the repository on `Github `_. +For the source code, please take a look at the repository on `GitHub `_. diff --git a/hiclass/HierarchicalClassifier.py b/hiclass/HierarchicalClassifier.py index 0de6e611..b58f3a61 100644 --- a/hiclass/HierarchicalClassifier.py +++ b/hiclass/HierarchicalClassifier.py @@ -107,7 +107,7 @@ def __init__( a single unique class. n_jobs : int, default=1 The number of jobs to run in parallel. Only :code:`fit` is parallelized. - If :code:`Ray` is installed it is used, otherwise it defaults to :code:`Joblib`. + If :code:`Ray` is installed it is used; otherwise, it defaults to :code:`Joblib`. classifier_abbreviation : str, default="" The abbreviation of the local hierarchical classifier to be displayed during logging. calibration_method : {"ivap", "cvap", "platt", "isotonic", "beta"}, str, default=None @@ -359,7 +359,7 @@ def _create_digraph(self): self._create_digraph_2d() if self.y_.ndim > 2: - # Unsuported dimension + # Unsupported dimension self.logger_.error(f"y with {self.y_.ndim} dimensions detected") raise ValueError( f"Creating graph from y with {self.y_.ndim} dimensions is not supported" diff --git a/hiclass/LocalClassifierPerLevel.py b/hiclass/LocalClassifierPerLevel.py index 44f55fcb..0de62d7e 100644 --- a/hiclass/LocalClassifierPerLevel.py +++ b/hiclass/LocalClassifierPerLevel.py @@ -77,7 +77,7 @@ def __init__( a single unique class. n_jobs : int, default=1 The number of jobs to run in parallel. Only :code:`fit` is parallelized. - If :code:`Ray` is installed it is used, otherwise it defaults to :code:`Joblib`. + If :code:`Ray` is installed it is used; otherwise, it defaults to :code:`Joblib`. calibration_method : {"ivap", "cvap", "platt", "isotonic", "beta"}, str, default=None If set, use the desired method to calibrate probabilities returned by predict_proba(). return_all_probabilities : bool, default=False diff --git a/hiclass/LocalClassifierPerNode.py b/hiclass/LocalClassifierPerNode.py index 71c2f435..daf1d281 100644 --- a/hiclass/LocalClassifierPerNode.py +++ b/hiclass/LocalClassifierPerNode.py @@ -84,7 +84,7 @@ def __init__( a single unique class. n_jobs : int, default=1 The number of jobs to run in parallel. Only :code:`fit` is parallelized. - If :code:`Ray` is installed it is used, otherwise it defaults to :code:`Joblib`. + If :code:`Ray` is installed it is used; otherwise, it defaults to :code:`Joblib`. calibration_method : {"ivap", "cvap", "platt", "isotonic", "beta"}, str, default=None If set, use the desired method to calibrate probabilities returned by predict_proba(). return_all_probabilities : bool, default=False diff --git a/hiclass/LocalClassifierPerParentNode.py b/hiclass/LocalClassifierPerParentNode.py index 2d7a5c53..6ab3c295 100644 --- a/hiclass/LocalClassifierPerParentNode.py +++ b/hiclass/LocalClassifierPerParentNode.py @@ -71,7 +71,7 @@ def __init__( a single unique class. n_jobs : int, default=1 The number of jobs to run in parallel. Only :code:`fit` is parallelized. - If :code:`Ray` is installed it is used, otherwise it defaults to :code:`Joblib`. + If :code:`Ray` is installed it is used; otherwise, it defaults to :code:`Joblib`. calibration_method : {"ivap", "cvap", "platt", "isotonic", "beta"}, str, default=None If set, use the desired method to calibrate probabilities returned by predict_proba(). return_all_probabilities : bool, default=False diff --git a/hiclass/_calibration/VennAbersCalibrator.py b/hiclass/_calibration/VennAbersCalibrator.py index 31e16a7c..04df3f8e 100644 --- a/hiclass/_calibration/VennAbersCalibrator.py +++ b/hiclass/_calibration/VennAbersCalibrator.py @@ -167,7 +167,7 @@ def predict_proba(self, scores: np.ndarray, X: np.ndarray = None): return p1 / (1 - p0 + p1) - def predict_intervall(self, scores: np.ndarray): + def predict_interval(self, scores: np.ndarray): lower = np.searchsorted(self._unique_elements, scores, side="left") upper = np.searchsorted(self._unique_elements[:-1], scores, side="right") + 1 p0 = self._F0[lower] @@ -289,7 +289,7 @@ def predict_proba(self, scores: np.ndarray): continue for calibrator in self.ovr_ivaps[idx]: - res.append(calibrator.predict_intervall(scores)) + res.append(calibrator.predict_interval(scores)) res = np.array(res) @@ -310,7 +310,7 @@ def predict_proba(self, scores: np.ndarray): else: res = [] for calibrator in self.ivaps: - res.append(calibrator.predict_intervall(scores)) + res.append(calibrator.predict_interval(scores)) res = np.array(res) p0 = res[:, :, 0] diff --git a/tests/test_calibration.py b/tests/test_calibration.py index 6e419895..98789b53 100644 --- a/tests/test_calibration.py +++ b/tests/test_calibration.py @@ -160,7 +160,7 @@ def test_inductive_venn_abers_calibrator(binary_calibration_data, binary_test_sc calibrator = _InductiveVennAbersCalibrator() calibrator.fit(scores=scores[:, 1], y=ground_truth_labels) - intervalls = calibrator.predict_intervall(test_scores[:, 1]) + intervals = calibrator.predict_interval(test_scores[:, 1]) proba = calibrator.predict_proba(test_scores[:, 1]) assert_array_almost_equal( @@ -188,7 +188,7 @@ def test_inductive_venn_abers_calibrator(binary_calibration_data, binary_test_sc ), ) assert_array_almost_equal( - intervalls, + intervals, np.array( [ [0.66666666, 1.0], diff --git a/versioneer.py b/versioneer.py index 045991db..50e9a520 100644 --- a/versioneer.py +++ b/versioneer.py @@ -110,11 +110,11 @@ available. * `['dirty']`: a boolean, True if the tree has uncommitted changes. Note that - this is only accurate if run in a VCS checkout, otherwise it is likely to + this is only accurate if run in a VCS checkout; otherwise, it is likely to be False or None * `['error']`: if the version string could not be computed, this will be set - to a string describing the problem, otherwise it will be None. It may be + to a string describing the problem; otherwise, it will be None. It may be useful to throw an exception in setup.py if this is set, to avoid e.g. creating tarballs with a version string of "unknown". @@ -161,7 +161,7 @@ ## Known Limitations Some situations are known to cause problems for Versioneer. This details the -most significant ones. More can be found on Github +most significant ones. More can be found on GitHub [issues page](https://github.com/python-versioneer/python-versioneer/issues). ### Subprojects