mirror of
https://github.com/microsoft/FLAML.git
synced 2026-02-09 02:09:16 +08:00
Add support to python 3.13 (#1486)
This commit is contained in:
7
.github/workflows/python-package.yml
vendored
7
.github/workflows/python-package.yml
vendored
@@ -40,7 +40,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest]
|
os: [ubuntu-latest, windows-latest]
|
||||||
python-version: ["3.10", "3.11", "3.12"]
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
@@ -74,6 +74,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install pyspark==4.0.1
|
pip install pyspark==4.0.1
|
||||||
pip list | grep "pyspark"
|
pip list | grep "pyspark"
|
||||||
|
- name: On Ubuntu python 3.13, install pyspark 4.1.0
|
||||||
|
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
|
||||||
|
run: |
|
||||||
|
pip install pyspark==4.1.0
|
||||||
|
pip list | grep "pyspark"
|
||||||
# # TODO: support ray
|
# # TODO: support ray
|
||||||
# - name: If linux and python<3.11, install ray 2
|
# - name: If linux and python<3.11, install ray 2
|
||||||
# if: matrix.os == 'ubuntu-latest' && matrix.python-version < '3.11'
|
# if: matrix.os == 'ubuntu-latest' && matrix.python-version < '3.11'
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ FLAML has a .NET implementation in [ML.NET](http://dot.net/ml), an open-source,
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
The latest version of FLAML requires **Python >= 3.10 and < 3.13**. While other Python versions may work for core components, full model support is not guaranteed. FLAML can be installed via `pip`:
|
The latest version of FLAML requires **Python >= 3.10 and < 3.14**. While other Python versions may work for core components, full model support is not guaranteed. FLAML can be installed via `pip`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install flaml
|
pip install flaml
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = "2.4.1"
|
__version__ = "2.4.2"
|
||||||
|
|||||||
12
setup.py
12
setup.py
@@ -52,8 +52,8 @@ setuptools.setup(
|
|||||||
],
|
],
|
||||||
"test": [
|
"test": [
|
||||||
"numpy>=1.17,<2.0.0; python_version<'3.13'",
|
"numpy>=1.17,<2.0.0; python_version<'3.13'",
|
||||||
"numpy>2.0.0; python_version>='3.13'",
|
"numpy>=1.17; python_version>='3.13'",
|
||||||
"jupyter; python_version<'3.13'",
|
"jupyter",
|
||||||
"lightgbm>=2.3.1",
|
"lightgbm>=2.3.1",
|
||||||
"xgboost>=0.90,<2.0.0; python_version<'3.11'",
|
"xgboost>=0.90,<2.0.0; python_version<'3.11'",
|
||||||
"xgboost>=2.0.0; python_version>='3.11'",
|
"xgboost>=2.0.0; python_version>='3.11'",
|
||||||
@@ -68,10 +68,10 @@ setuptools.setup(
|
|||||||
"pre-commit",
|
"pre-commit",
|
||||||
"torch",
|
"torch",
|
||||||
"torchvision",
|
"torchvision",
|
||||||
"catboost>=0.26; python_version<'3.13'",
|
"catboost>=0.26",
|
||||||
"rgf-python",
|
"rgf-python",
|
||||||
"optuna>=2.8.0,<=3.6.1",
|
"optuna>=2.8.0,<=3.6.1",
|
||||||
"openml; python_version<'3.13'",
|
"openml",
|
||||||
"statsmodels>=0.12.2",
|
"statsmodels>=0.12.2",
|
||||||
"psutil",
|
"psutil",
|
||||||
"dataclasses",
|
"dataclasses",
|
||||||
@@ -82,7 +82,7 @@ setuptools.setup(
|
|||||||
"rouge_score",
|
"rouge_score",
|
||||||
"hcrystalball",
|
"hcrystalball",
|
||||||
"seqeval",
|
"seqeval",
|
||||||
"pytorch-forecasting; python_version<'3.13'",
|
"pytorch-forecasting",
|
||||||
"mlflow-skinny<=2.22.1", # Refer to https://mvnrepository.com/artifact/org.mlflow/mlflow-spark
|
"mlflow-skinny<=2.22.1", # Refer to https://mvnrepository.com/artifact/org.mlflow/mlflow-spark
|
||||||
"joblibspark>=0.5.0",
|
"joblibspark>=0.5.0",
|
||||||
"joblib<=1.3.2",
|
"joblib<=1.3.2",
|
||||||
@@ -140,7 +140,7 @@ setuptools.setup(
|
|||||||
"prophet>=1.1.5",
|
"prophet>=1.1.5",
|
||||||
"statsmodels>=0.12.2",
|
"statsmodels>=0.12.2",
|
||||||
"hcrystalball>=0.1.10",
|
"hcrystalball>=0.1.10",
|
||||||
"pytorch-forecasting>=0.10.4; python_version<'3.13'",
|
"pytorch-forecasting>=0.10.4",
|
||||||
"pytorch-lightning>=1.9.0",
|
"pytorch-lightning>=1.9.0",
|
||||||
"tensorboardX>=2.6",
|
"tensorboardX>=2.6",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -188,7 +188,11 @@ def _test_sparse_matrix_classification(estimator):
|
|||||||
"n_jobs": 1,
|
"n_jobs": 1,
|
||||||
"model_history": True,
|
"model_history": True,
|
||||||
}
|
}
|
||||||
X_train = scipy.sparse.random(1554, 21, dtype=int)
|
# NOTE: Avoid `dtype=int` here. On some NumPy/SciPy combinations (notably
|
||||||
|
# Windows + Python 3.13), `scipy.sparse.random(..., dtype=int)` may trigger
|
||||||
|
# integer sampling paths which raise "low is out of bounds for int32".
|
||||||
|
# A float sparse matrix is sufficient to validate sparse-input support.
|
||||||
|
X_train = scipy.sparse.random(1554, 21, dtype=np.float32)
|
||||||
y_train = np.random.randint(3, size=1554)
|
y_train = np.random.randint(3, size=1554)
|
||||||
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)
|
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)
|
||||||
|
|
||||||
|
|||||||
@@ -368,7 +368,11 @@ class TestMultiClass(unittest.TestCase):
|
|||||||
"n_jobs": 1,
|
"n_jobs": 1,
|
||||||
"model_history": True,
|
"model_history": True,
|
||||||
}
|
}
|
||||||
X_train = scipy.sparse.random(1554, 21, dtype=int)
|
# NOTE: Avoid `dtype=int` here. On some NumPy/SciPy combinations (notably
|
||||||
|
# Windows + Python 3.13), `scipy.sparse.random(..., dtype=int)` may trigger
|
||||||
|
# integer sampling paths which raise "low is out of bounds for int32".
|
||||||
|
# A float sparse matrix is sufficient to validate sparse-input support.
|
||||||
|
X_train = scipy.sparse.random(1554, 21, dtype=np.float32)
|
||||||
y_train = np.random.randint(3, size=1554)
|
y_train = np.random.randint(3, size=1554)
|
||||||
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)
|
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)
|
||||||
print(automl_experiment.classes_)
|
print(automl_experiment.classes_)
|
||||||
|
|||||||
@@ -262,7 +262,11 @@ class TestMultiClass(unittest.TestCase):
|
|||||||
"n_concurrent_trials": 2,
|
"n_concurrent_trials": 2,
|
||||||
"use_spark": True,
|
"use_spark": True,
|
||||||
}
|
}
|
||||||
X_train = scipy.sparse.random(1554, 21, dtype=int)
|
# NOTE: Avoid `dtype=int` here. On some NumPy/SciPy combinations (notably
|
||||||
|
# Windows + Python 3.13), `scipy.sparse.random(..., dtype=int)` may trigger
|
||||||
|
# integer sampling paths which raise "low is out of bounds for int32".
|
||||||
|
# A float sparse matrix is sufficient to validate sparse-input support.
|
||||||
|
X_train = scipy.sparse.random(1554, 21, dtype=np.float32)
|
||||||
y_train = np.random.randint(3, size=1554)
|
y_train = np.random.randint(3, size=1554)
|
||||||
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)
|
automl_experiment.fit(X_train=X_train, y_train=y_train, **automl_settings)
|
||||||
print(automl_experiment.classes_)
|
print(automl_experiment.classes_)
|
||||||
|
|||||||
Reference in New Issue
Block a user