Skip to content

Commit

Permalink
Merge f5bc23b into bca071f
Browse files Browse the repository at this point in the history
  • Loading branch information
lukapecnik committed Nov 30, 2020
2 parents bca071f + f5bc23b commit a179b3e
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 10 deletions.
17 changes: 15 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"doc",
"review",
"bug",
"example"
"example",
"test"
]
},
{
Expand All @@ -25,7 +26,19 @@
"profile": "https://github.com/firefly-cpp",
"contributions": [
"code",
"bug"
"bug",
"mentoring",
"research",
"ideas"
]
},
{
"login": "sisco0",
"name": "sisco0",
"avatar_url": "https://avatars0.githubusercontent.com/u/25695302?v=4",
"profile": "https://github.com/sisco0",
"contributions": [
"ideas"
]
}
],
Expand Down
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: python
python:
- 3.8
before_install:
- pip install poetry
install:
- poetry install
script:
- poetry run coverage run --source=niaaml -m unittest discover -b
- poetry run coveralls
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/niaaml.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/niaaml.svg)
[![GitHub license](https://img.shields.io/github/license/lukapecnik/niaaml.svg)](https://github.com/lukapecnik/niaaml/blob/master/LICENSE)
[![Build Status](https://travis-ci.com/lukapecnik/NiaAML.svg?branch=master)](https://travis-ci.com/lukapecnik/NiaAML)
[![Coverage Status](https://coveralls.io/repos/github/lukapecnik/NiaAML/badge.svg?branch=master)](https://coveralls.io/github/lukapecnik/NiaAML?branch=master)

![GitHub commit activity](https://img.shields.io/github/commit-activity/w/lukapecnik/niaaml.svg)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/lukapecnik/niaaml.svg)](http://isitmaintained.com/project/lukapecnik/niaaml "Average time to resolve an issue")
Expand Down Expand Up @@ -166,8 +168,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/lukapecnik"><img src="https://avatars0.githubusercontent.com/u/23029992?s=460&u=d1c802fd8c82af0a020b1e21af80a34d6e28fb10&v=4?s=100" width="100px;" alt=""/><br /><sub><b>Luka Pečnik</b></sub></a><br /><a href="https://github.com/lukapecnik/NiaAML/commits?author=lukapecnik" title="Code">💻</a> <a href="https://github.com/lukapecnik/NiaAML/commits?author=lukapecnik" title="Documentation">📖</a> <a href="https://github.com/lukapecnik/NiaAML/pulls?q=is%3Apr+reviewed-by%3Alukapecnik" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/lukapecnik/NiaAML/issues?q=author%3Alukapecnik" title="Bug reports">🐛</a> <a href="#example-lukapecnik" title="Examples">💡</a></td>
<td align="center"><a href="https://github.com/firefly-cpp"><img src="https://avatars2.githubusercontent.com/u/1633361?v=4?s=100" width="100px;" alt=""/><br /><sub><b>firefly-cpp</b></sub></a><br /><a href="https://github.com/lukapecnik/NiaAML/commits?author=firefly-cpp" title="Code">💻</a> <a href="https://github.com/lukapecnik/NiaAML/issues?q=author%3Afirefly-cpp" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/lukapecnik"><img src="https://avatars0.githubusercontent.com/u/23029992?s=460&u=d1c802fd8c82af0a020b1e21af80a34d6e28fb10&v=4?s=100" width="100px;" alt=""/><br /><sub><b>Luka Pečnik</b></sub></a><br /><a href="https://github.com/lukapecnik/NiaAML/commits?author=lukapecnik" title="Code">💻</a> <a href="https://github.com/lukapecnik/NiaAML/commits?author=lukapecnik" title="Documentation">📖</a> <a href="https://github.com/lukapecnik/NiaAML/pulls?q=is%3Apr+reviewed-by%3Alukapecnik" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/lukapecnik/NiaAML/issues?q=author%3Alukapecnik" title="Bug reports">🐛</a> <a href="#example-lukapecnik" title="Examples">💡</a> <a href="https://github.com/lukapecnik/NiaAML/commits?author=lukapecnik" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/firefly-cpp"><img src="https://avatars2.githubusercontent.com/u/1633361?v=4?s=100" width="100px;" alt=""/><br /><sub><b>firefly-cpp</b></sub></a><br /><a href="https://github.com/lukapecnik/NiaAML/commits?author=firefly-cpp" title="Code">💻</a> <a href="https://github.com/lukapecnik/NiaAML/issues?q=author%3Afirefly-cpp" title="Bug reports">🐛</a> <a href="#mentoring-firefly-cpp" title="Mentoring">🧑‍🏫</a> <a href="#research-firefly-cpp" title="Research">🔬</a> <a href="#ideas-firefly-cpp" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/sisco0"><img src="https://avatars0.githubusercontent.com/u/25695302?v=4?s=100" width="100px;" alt=""/><br /><sub><b>sisco0</b></sub></a><br /><a href="#ideas-sisco0" title="Ideas, Planning, & Feedback">🤔</a></td>
</tr>
</table>

Expand Down
12 changes: 12 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
NiaAML
======

.. image:: https://travis-ci.com/lukapecnik/NiaAML.svg?branch=master
:target: https://travis-ci.com/lukapecnik/NiaAML

.. image:: https://coveralls.io/repos/github/lukapecnik/NiaAML/badge.svg?branch=travisCI_integration
:target: https://coveralls.io/github/lukapecnik/NiaAML?branch=travisCI_integration

.. image:: https://img.shields.io/pypi/pyversions/niaaml.svg
:target: https://pypi.org/project/NiaPy/

.. image:: https://img.shields.io/github/license/lukapecnik/niaaml.svg
:target: https://github.com/lukapecnik/niaaml/blob/master/LICENSE

NiaAML is an automated machine learning Python framework based on
nature-inspired algorithms for optimization. The name comes from the
automated machine learning method of the same name [1]. Its
Expand Down
10 changes: 5 additions & 5 deletions niaaml/tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PipelineTestCase(TestCase):
def setUp(self):
self.__pipeline = Pipeline(
feature_selection_algorithm=SelectKBest(),
feature_transform_algorithm=StandardScaler(),
feature_transform_algorithm=Normalizer(),
classifier=Bagging()
)

Expand All @@ -21,7 +21,7 @@ def test_pipeline_optimize_works_fine(self):

self.assertIsInstance(self.__pipeline.get_classifier(), Bagging)
self.assertIsInstance(self.__pipeline.get_feature_selection_algorithm(), SelectKBest)
self.assertIsInstance(self.__pipeline.get_feature_transform_algorithm(), StandardScaler)
self.assertIsInstance(self.__pipeline.get_feature_transform_algorithm(), Normalizer)

accuracy = self.__pipeline.optimize(data_reader.get_x(), data_reader.get_y(), 10, 30, 'ParticleSwarmAlgorithm', 'Accuracy')

Expand All @@ -30,7 +30,7 @@ def test_pipeline_optimize_works_fine(self):

self.assertIsInstance(self.__pipeline.get_classifier(), Bagging)
self.assertIsInstance(self.__pipeline.get_feature_selection_algorithm(), SelectKBest)
self.assertIsInstance(self.__pipeline.get_feature_transform_algorithm(), StandardScaler)
self.assertIsInstance(self.__pipeline.get_feature_transform_algorithm(), Normalizer)

def test_pipeline_run_works_fine(self):
data_reader = CSVDataReader(src=os.path.dirname(os.path.abspath(__file__)) + '/tests_files/dataset_header_classes.csv', has_header=True, contains_classes=True)
Expand Down Expand Up @@ -70,7 +70,7 @@ def test_pipeline_export_text_works_fine(self):
def test_pipeline_setters_work_fine(self):
self.__pipeline.set_classifier(AdaBoost())
self.__pipeline.set_feature_selection_algorithm(SelectPercentile())
self.__pipeline.set_feature_transform_algorithm(Normalizer())
self.__pipeline.set_feature_transform_algorithm(StandardScaler())
self.__pipeline.set_selected_features_mask(numpy.ones([1, 1, 0, 0], dtype=bool))

self.__y = numpy.array(['Class 1', 'Class 1', 'Class 1', 'Class 2', 'Class 1', 'Class 2',
Expand All @@ -85,5 +85,5 @@ def test_pipeline_setters_work_fine(self):

self.assertIsInstance(self.__pipeline.get_classifier(), AdaBoost)
self.assertIsInstance(self.__pipeline.get_feature_selection_algorithm(), SelectPercentile)
self.assertIsInstance(self.__pipeline.get_feature_transform_algorithm(), Normalizer)
self.assertIsInstance(self.__pipeline.get_feature_transform_algorithm(), StandardScaler)
self.assertIsInstance(self.__pipeline.get_stats(), OptimizationStats)
80 changes: 79 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ NiaPy = "^2.0.0rc11"
[tool.poetry.dev-dependencies]
sphinx = "^3.3.1"
sphinx-rtd-theme = "^0.5.0"
coveralls = "^2.2.0"

[build-system]
requires = ["poetry>=0.12"]
Expand Down

0 comments on commit a179b3e

Please sign in to comment.