Skip to content

Commit

Permalink
Merge branch 'master' into Refactor-bias_variance_decomposition-unit-…
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
rasbt authored Mar 28, 2024
2 parents f95438a + 9fd9913 commit 1aa2079
Show file tree
Hide file tree
Showing 25 changed files with 41 additions and 47 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,34 @@ jobs:
runs-on: ubuntu-latest
strategy:
max-parallel: 5

env:
GITHUB_ACTIONS_CI: true
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.9
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install packages and test with pytest
channels: conda-forge
activate-environment: mlxtend
environment-file: environment.yml
create-env-file: true

- name: Install dependencies and run tests
shell: bash -l {0}
run: |
conda config --add channels conda-forge
conda update conda -y -q
conda env update --file environment.yml --name base
pip install scikit-learn==1.1.3
pip install pandas==1.3.5
conda install tensorflow joblib pytest -y -q
conda install imageio scikit-image -y -q
conda install dlib -y -q
pip install markdown
pip install coverage
pip install -e .
pip install scikit-learn==1.1.3 pandas==1.3.5 markdown coverage
pip install -e .
python -c "import numpy; print('NumPy:', numpy.__version__)"
python -c "import scipy; print('SciPy:', scipy.__version__)"
python -c "import sklearn; print('Scikit-learn:', sklearn.__version__)"
python -c "import pandas; print('Pandas:', pandas.__version__)"
coverage run --source=mlxtend --branch -m pytest mlxtend
coverage xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v2
5 changes: 3 additions & 2 deletions docs/sources/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ $ source activate mlxtend-testing

### 2. Installing the package from local files

Test the installation by executing
Test the installation by executing the following from within the mlxtend main directory:

```bash
$ python setup.py install --record files.txt
$ pip install . -e
```

the `--record files.txt` flag will create a `files.txt` file listing the locations where these files will be installed.
Expand All @@ -430,6 +430,7 @@ $ cat files.txt | xargs rm -rf ; rm files.txt
Next, test if `pip` is able to install the packages. First, navigate to a different directory, and from there, install the package:

```bash
$ pip uninstall
$ pip install mlxtend
```

Expand Down
6 changes: 3 additions & 3 deletions docs/sources/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ To install mlxtend, just execute
pip install mlxtend
```

Alternatively, you download the package manually from the Python Package Index [https://pypi.python.org/pypi/mlxtend](https://pypi.python.org/pypi/mlxtend), unzip it, navigate into the package, and use the command:
Alternatively, you download the package manually from the Python Package Index [https://pypi.python.org/pypi/mlxtend](https://pypi.python.org/pypi/mlxtend), unzip it, navigate into the package, and use the following command from inside the mlxtend folder:

```bash
python setup.py install
pip install .
```

##### Upgrading via `pip`
Expand Down Expand Up @@ -61,5 +61,5 @@ pip install git+git://github.com/rasbt/mlxtend.git
Or, you can fork the GitHub repository from https://github.com/rasbt/mlxtend and install mlxtend from your local drive via

```bash
python setup.py install
pip install .
```
4 changes: 2 additions & 2 deletions docs/sources/user_guide/classifier/OneRClassifier.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# OneRClassifier: One Rule (OneR) method for classfication"
"# OneRClassifier: One Rule (OneR) method for classification"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And implementation of the One Rule (OneR) method for classfication."
"And implementation of the One Rule (OneR) method for classification."
]
},
{
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/adaline.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class Adaline(_BaseModel, _IterativeModel, _Classifier):

"""ADAptive LInear NEuron classifier.
Note that this implementation of Adaline expects binary class labels
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/ensemble_vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


class EnsembleVoteClassifier(BaseEstimator, ClassifierMixin, TransformerMixin):

"""Soft Voting/Majority Rule classifier for scikit-learn estimators.
Parameters
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/logistic_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class LogisticRegression(_BaseModel, _IterativeModel, _Classifier):

"""Logistic regression classifier.
Note that this implementation of Logistic Regression
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/multilayerperceptron.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
class MultiLayerPerceptron(
_BaseModel, _IterativeModel, _MultiClass, _MultiLayer, _Classifier
):

"""Multi-layer perceptron classifier with logistic sigmoid activations
Parameters
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/oner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class OneRClassifier(BaseEstimator, ClassifierMixin):

"""OneR (One Rule) Classifier.
Parameters
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/perceptron.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class Perceptron(_BaseModel, _IterativeModel, _Classifier):

"""Perceptron classifier.
Note that this implementation of the Perceptron expects binary class labels
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/softmax_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class SoftmaxRegression(_BaseModel, _IterativeModel, _Classifier, _MultiClass):

"""Softmax regression classifier.
Parameters
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/stacking_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


class StackingClassifier(_BaseXComposition, _BaseStackingClassifier, TransformerMixin):

"""A Stacking classifier for scikit-learn estimators for classification.
Parameters
Expand Down
1 change: 0 additions & 1 deletion mlxtend/classifier/stacking_cv_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
class StackingCVClassifier(
_BaseXComposition, _BaseStackingClassifier, TransformerMixin
):

"""A 'Stacking Cross-Validation' classifier for scikit-learn estimators.
New in mlxtend v0.4.3
Expand Down
7 changes: 6 additions & 1 deletion mlxtend/evaluate/tests/test_bias_variance_decomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ def test_mse_bagging():
APPVEYOR = False


@pytest.mark.skipif(TRAVIS or APPVEYOR, reason="TensorFlow dependency")
GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS_CI", "false").lower() == "true"


@pytest.mark.skipif(
TRAVIS or APPVEYOR or GITHUB_ACTIONS, reason="TensorFlow dependency"
)
def test_keras():
import tensorflow as tf

Expand Down
7 changes: 6 additions & 1 deletion mlxtend/evaluate/tests/test_bootstrap_point632.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,12 @@ def test_scoring_proba():
APPVEYOR = False


@pytest.mark.skipif(TRAVIS or APPVEYOR, reason="TensorFlow dependency")
GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS_CI", "false").lower() == "true"


@pytest.mark.skipif(
TRAVIS or APPVEYOR or GITHUB_ACTIONS, reason="TensorFlow dependency"
)
def test_keras_fitparams():
import tensorflow as tf

Expand Down
1 change: 0 additions & 1 deletion mlxtend/externals/pyprind/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
PyPI: https://pypi.python.org/pypi/PyPrind
"""


from .generator_factory import prog_bar, prog_percent
from .progbar import ProgBar
from .progpercent import ProgPercent
Expand Down
1 change: 0 additions & 1 deletion mlxtend/externals/pyprind/prog_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
PyPI: https://pypi.python.org/pypi/PyPrind
"""


import os
import sys
import time
Expand Down
1 change: 0 additions & 1 deletion mlxtend/externals/pyprind/progbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
PyPI: https://pypi.python.org/pypi/PyPrind
"""


import time
from math import floor

Expand Down
1 change: 0 additions & 1 deletion mlxtend/feature_selection/exhaustive_feature_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


class ExhaustiveFeatureSelector(BaseEstimator, MetaEstimatorMixin):

"""Exhaustive Feature Selection for Classification and Regression.
(new in v0.4.3)
Expand Down
1 change: 0 additions & 1 deletion mlxtend/feature_selection/sequential_feature_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


class SequentialFeatureSelector(_BaseXComposition, MetaEstimatorMixin):

"""Sequential Feature Selection for Classification and Regression.
Parameters
Expand Down
8 changes: 5 additions & 3 deletions mlxtend/plotting/plot_confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ def plot_confusion_matrix(
s=cell_text,
va="center",
ha="center",
color="white"
if conf_mat[i, j] > np.max(conf_mat) * fontcolor_threshold
else "black",
color=(
"white"
if conf_mat[i, j] > np.max(conf_mat) * fontcolor_threshold
else "black"
),
)
if class_names is not None:
tick_marks = np.arange(len(class_names))
Expand Down
1 change: 0 additions & 1 deletion mlxtend/preprocessing/mean_centering.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class MeanCenterer(object):

"""Column centering of vectors and matrices.
Attributes
Expand Down
1 change: 0 additions & 1 deletion mlxtend/regressor/linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class LinearRegression(_BaseModel, _IterativeModel, _Regressor):

"""Ordinary least squares linear regression.
Parameters
Expand Down
1 change: 0 additions & 1 deletion mlxtend/regressor/stacking_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


class StackingRegressor(_BaseXComposition, RegressorMixin, TransformerMixin):

"""A Stacking regressor for scikit-learn estimators for regression.
Parameters
Expand Down
1 change: 0 additions & 1 deletion mlxtend/utils/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class Counter(object):

"""Class to display the progress of for-loop iterators.
Parameters
Expand Down

0 comments on commit 1aa2079

Please sign in to comment.