Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add_test_basic #4

Merged
merged 5 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
codecov:
notify:
require_ci_to_pass: yes

coverage:
precision: 2 # 2 = xx.xx%, 0 = xx%
round: nearest # how coverage is rounded: down/up/nearest
range: 10...90 # custom range of coverage colors from red -> yellow -> green
status:
# https://codecov.readme.io/v1.0/docs/commit-status
project:
default:
against: auto
target: 70% # specify the target coverage for each commit status
threshold: 50% # allow this little decrease on project
# https://github.com/codecov/support/wiki/Filtering-Branches
# branches: master
if_ci_failed: error
# https://github.com/codecov/support/wiki/Patch-Status
patch:
default:
against: auto
target: 30% # specify the target "X%" coverage to hit
threshold: 50% # allow this much decrease on patch
changes: false

parsers:
gcov:
branch_detection:
conditional: true
loop: true
macro: false
method: false
javascript:
enable_partials: false

comment:
layout: header, diff
require_changes: false
behavior: default # update if exists else create new
branches: ["master"]
23 changes: 23 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CodeCov
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
PYTHON: "3.9"
steps:
- uses: checkout@v2
with:
fetch-depth: ‘2’

- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.7
- name: Generate Report
run: |
pip install coverage
coverage run -m unittest
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
17 changes: 17 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: GitHub Actions
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
venv/
.vscode/
__pycache__/
*.py[cod]
.DS_Store
notes.md
.coverage
htmlcov/*
Binary file modified My_AutoML/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/__pycache__/_base.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_balancing/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_balancing/__pycache__/_mixed_sampling.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_balancing/__pycache__/_over_sampling.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_balancing/__pycache__/_under_sampling.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_encoding/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_encoding/__pycache__/_encoding.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_feature_selection/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_feature_selection/__pycache__/_advance.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_feature_selection/__pycache__/_base.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_feature_selection/__pycache__/_imported.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_hpo/__pycache__/_DL.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_hpo/__pycache__/_ML.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_hpo/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_hpo/__pycache__/_base.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_hyperparameters/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified My_AutoML/_imputation/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_imputation/__pycache__/_base.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_imputation/__pycache__/_clustering.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_imputation/__pycache__/_multiple.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_imputation/__pycache__/_nn.cpython-39.pyc
Binary file not shown.
5 changes: 4 additions & 1 deletion My_AutoML/_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Author: Panyi Dong (panyid2@illinois.edu)

-----
Last Modified: Friday, 8th April 2022 10:25:54 pm
Last Modified: Saturday, 9th April 2022 11:44:01 am
Modified By: Panyi Dong (panyid2@illinois.edu)

-----
Expand Down Expand Up @@ -49,6 +49,9 @@
LogisticRegression,
)
from sklearn.naive_bayes import ComplementNB

# need to enable hist gradient boosting features first
from sklearn.experimental import enable_hist_gradient_boosting
from sklearn.ensemble import (
HistGradientBoostingClassifier,
HistGradientBoostingRegressor,
Expand Down
Binary file modified My_AutoML/_model/__pycache__/_FNN.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_model/__pycache__/_RNN.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_model/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_scaling/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_scaling/__pycache__/_scaling.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_utils/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_utils/__pycache__/_base.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_utils/__pycache__/_data.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_utils/__pycache__/_file.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file modified My_AutoML/_utils/__pycache__/_preprocessing.cpython-39.pyc
Binary file not shown.
Binary file modified My_AutoML/_utils/__pycache__/_stat.cpython-39.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Author: Panyi Dong (panyid2@illinois.edu)

-----
Last Modified: Friday, 8th April 2022 10:12:11 am
Last Modified: Saturday, 9th April 2022 11:41:20 am
Modified By: Panyi Dong (panyid2@illinois.edu)

-----
Expand Down Expand Up @@ -71,7 +71,7 @@ def get_ext_path(root_dir, exclude_files):

setup(
name="My_AutoML",
version="0.0.2",
version="0.2.0",
packages=find_packages(),
# ext_modules = cythonize(
# get_ext_path("My_AutoML", EXCLUDE_FILES),
Expand Down
Binary file added tests/__pycache__/basic.cpython-39.pyc
Binary file not shown.
71 changes: 71 additions & 0 deletions tests/basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""
File: basic.py
Author: Panyi Dong
GitHub: https://github.com/PanyiDong/
Mathematics Department, University of Illinois at Urbana-Champaign (UIUC)

Project: My_AutoML
Latest Version: 0.2.0
Relative Path: /tests/basic.py
File Created: Saturday, 9th April 2022 11:25:27 am
Author: Panyi Dong (panyid2@illinois.edu)

-----
Last Modified: Saturday, 9th April 2022 11:51:42 am
Modified By: Panyi Dong (panyid2@illinois.edu)

-----
MIT License

Copyright (c) 2022 - 2022, Panyi Dong

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import unittest
import numpy as np
import pandas as pd

from My_AutoML._utils import get_missing_matrix

data = pd.DataFrame(
{
"col_1": [1, 2, np.nan, 4],
"col_2": [np.nan, 3, np.nan, 5],
}
)

expected_result = pd.DataFrame(
{
"col_1": [0, 0, 1, 0],
"col_2": [1, 0, 1, 0],
}
)


class TestGetMissingMatrix(unittest.TestCase):
def setUp(self):
self.die = get_missing_matrix

def test_upper(self):
self.assertEqual(
(self.die(data) == expected_result.values).all(),
True,
"Should be {}, get {}.".format(expected_result.values, self.die(data)),
)