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

Change in requirements file: Numpy version should not be 2.x #145

Open
wants to merge 9 commits into
base: release
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
experimental: [false]
fail-fast: false
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
experimental: [false]
fail-fast: false
runs-on: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
test:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
experimental: [false]
fail-fast: false
runs-on: windows-latest
Expand Down
21 changes: 12 additions & 9 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/source/conf.py
configuration: docs/source/conf.py

formats: all

python:
version: 3.8
install:
- requirements: requirements.txt
- requirements: requirements-nn.txt
- requirements: docs/requirements.txt
-
method: setuptools
path: .
install:
- requirements: requirements.txt
- requirements: requirements-nn.txt
- requirements: docs/requirements.txt
- method: setuptools
path: .
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
### Add
- Added wheel package supported for `py3.12`

### Changed
- Update `pandas` version to `>=1.5`
- Python `3.7` is no longer supported

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The following showcases some of the most popular features of toad, for more deta
- Simple IV calculation for all features · 一键算IV:

```python
toad.quality(data,'target',iv_only=True)
toad.quality(data, 'target', indicators = ['iv'])
```

- Preliminary selection based on criteria · 根据特定条件的初步变量筛选;
Expand Down Expand Up @@ -118,10 +118,10 @@ We welcome public feedback and new PRs. We hold a WeChat group for questions and

## Dedicated by **The ESC Team**

[pypi-image]: https://img.shields.io/pypi/v/toad.svg?style=flat-square
[pypi-image]: https://img.shields.io/pypi/v/toad?style=flat-square
[pypi-url]: https://pypi.org/project/toad/
[python-image]: https://img.shields.io/pypi/pyversions/toad.svg?style=flat-square
[actions-image]: https://img.shields.io/github/workflow/status/amphibian-dev/toad/Release?style=flat-square
[python-image]: https://img.shields.io/pypi/pyversions/toad?style=flat-square
[actions-image]: https://img.shields.io/github/actions/workflow/status/amphibian-dev/toad/release.yml?style=flat-square
[actions-url]: https://github.com/amphibian-dev/toad/actions
[downloads-image]: https://img.shields.io/pypi/dm/toad?style=flat-square
[docs-url]: https://toad.readthedocs.io/
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ classifiers = [
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
]
dynamic = [
"version",
Expand Down
7 changes: 2 additions & 5 deletions requirements-nn.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
torch >= 1.8.1; sys_platform != 'darwin'
torchvision >= 0.9.1; sys_platform != 'darwin'

torch >= 1.8.1; sys_platform == 'darwin'
torchvision >= 0.9.1; sys_platform == 'darwin'
torch >= 1.8.1
torchvision >= 0.9.1
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Cython >= 0.29.15
numpy >= 1.20
numpy <= 2.0.0
pandas >= 1.5
scipy
joblib >= 0.12
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def get_requirements(stage = None):
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
entry_points = {
'console_scripts': [
Expand Down
4 changes: 2 additions & 2 deletions toad/metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ def test_KS_bucket_with_cum_lift():

def test_F1():
result, split = F1(feature, target, return_split = True)
assert result == 0.6844207723035951
assert result == pytest.approx(0.6844207723035951, FUZZ_THRESHOLD)

def test_F1_split():
result = F1(feature, target, split = 0.5)
assert result == 0.51417004048583
assert result == pytest.approx(0.51417004048583, FUZZ_THRESHOLD)

def test_AUC():
result = AUC(feature, target)
Expand Down
4 changes: 4 additions & 0 deletions toad/selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ def stepwise(frame, target = 'target', estimator = 'ols', direction = 'both', cr
test_res = np.empty(l, dtype = object)

if direction == 'backward':
# break when only one single feature left
if l < 2:
break

for i in range(l):
test_res[i] = sm.stats(
df[ remaining[:i] + remaining[i+1:] ],
Expand Down
1 change: 1 addition & 0 deletions toad/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def quality(dataframe, target = 'target', cpu_cores = 0, iv_only = False, indica
dataframe (DataFrame): dataframe that will be calculate quality
target (str): the target's name in dataframe
iv_only (bool): `deprecated`. if only calculate IV
indicators (list): indictors will be calc, it can be customized indictor functions, default is ['iv', 'gini', 'entropy', 'unique']
cpu_cores (int): the maximun number of CPU cores will be used, `0` means all CPUs will be used,
`-1` means all CPUs but one will be used.

Expand Down