diff --git a/setup.py b/setup.py index 91cb131..4d30f7c 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,6 @@ install_requires = [ "dill>=0.3.4", "joblib>=0.13.0", - "scikit-learn>=1.0", - "sklearn-pandas>=1.8.0" + "scikit-learn>=1.0" ] ) diff --git a/sklearn2pmml/__init__.py b/sklearn2pmml/__init__.py index 802b2f4..df76cd8 100644 --- a/sklearn2pmml/__init__.py +++ b/sklearn2pmml/__init__.py @@ -1,10 +1,14 @@ from pandas import CategoricalDtype +try: + from sklearn_pandas import DataFrameMapper +except ImportError: + class DataFrameMapper(object): + pass from sklearn.base import BaseEstimator from sklearn.compose import ColumnTransformer from sklearn.exceptions import NotFittedError from sklearn.feature_selection import SelectFromModel, SelectorMixin from sklearn.pipeline import FeatureUnion, Pipeline -from sklearn_pandas import DataFrameMapper from sklearn2pmml.resources import _package_classpath from subprocess import PIPE, Popen from zipfile import ZipFile @@ -17,7 +21,6 @@ import platform import re import sklearn -import sklearn_pandas import tempfile import warnings @@ -269,7 +272,6 @@ def sklearn2pmml(estimator, pmml_path, with_repr = False, java_home = None, java print("python: {0}".format(platform.python_version())) print("sklearn2pmml: {0}".format(__version__)) print("sklearn: {0}".format(sklearn.__version__)) - print("sklearn_pandas: {0}".format(sklearn_pandas.__version__)) print("pandas: {0}".format(pandas.__version__)) print("numpy: {0}".format(numpy.__version__)) print("dill: {0}".format(dill.__version__))