Merge pull request #99 from nyanp/feature/drop-old-python

drop supporting python 3.6/3.7
bugfix/flake8
nyanp 2023-07-10 23:39:11 +09:00 committed by GitHub
commit 6d5c1b82c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 8 deletions

View File

@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.8]
steps:
- uses: actions/checkout@v1

View File

@ -12,7 +12,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.6'
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip

View File

@ -11,7 +11,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.8]
steps:
- uses: actions/checkout@v1

View File

@ -2,7 +2,7 @@ from typing import List, Optional, Tuple
import numpy as np
import pandas as pd
from pandas.api.types import is_integer_dtype, is_categorical
from pandas.api.types import is_integer_dtype, is_categorical_dtype
from sklearn.preprocessing import LabelEncoder
@ -24,7 +24,7 @@ def autoprep_gbdt(algorithm_type: str, X_train: pd.DataFrame, X_test: Optional[p
if algorithm_type == 'lgbm':
# LightGBM can handle categorical dtype natively
categorical_feature_to_treat = [c for c in categorical_feature_to_treat if not is_categorical(X_train[c])]
categorical_feature_to_treat = [c for c in categorical_feature_to_treat if not is_categorical_dtype(X_train[c])]
if algorithm_type == 'cat' and len(categorical_feature_to_treat) > 0:
X_train = X_train.copy()
@ -49,7 +49,7 @@ def autoprep_gbdt(algorithm_type: str, X_train: pd.DataFrame, X_test: Optional[p
def _fill_na_by_unique_value(strain: pd.Series, stest: Optional[pd.Series]) -> Tuple[pd.Series, pd.Series]:
if is_categorical(strain):
if is_categorical_dtype(strain):
return strain.cat.codes, stest.cat.codes
elif is_integer_dtype(strain.dtype):
fillval = min(strain.min(), stest.min()) - 1

View File

@ -55,8 +55,6 @@ setup(
keywords='nyaggle kaggle',
classifiers=[
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8'
]
)