在Python中安装CatBoostClassifier时出现模糊错误

在Python中安装CatBoostClassifier时出现模糊错误,python,pandas,classification,catboost,Python,Pandas,Classification,Catboost,尝试将CatBoostClassifier与训练数据相匹配时,我收到一个模糊错误。我在下面创建了一个简单的数据集来帮助说明问题: from sklearn.model_selection import train_test_split # Initialize a dataframe d = {'response': [1,0,1,0,1,0,0,0,0,1], 'color': ['red','blue','yellow','blue','red','blue','blue','

尝试将CatBoostClassifier与训练数据相匹配时,我收到一个模糊错误。我在下面创建了一个简单的数据集来帮助说明问题:

from sklearn.model_selection import train_test_split

# Initialize a dataframe
d = {'response': [1,0,1,0,1,0,0,0,0,1], 
     'color': ['red','blue','yellow','blue','red','blue','blue','yellow','red','red'], 
     'status': ['open','pending','open','open','closed','pending','closed','open','closed','open'], 
     'age': [45,10,58,22,42,35,55,26,32,59], 
     'income': [95000,40000,100000,55000,70000,60000,45000,75000,65000,90000]}
df = pd.DataFrame(data=d)

# Create X and y matrices
X = df.drop(['response'], axis=1)
y = df.response

# Split into train and test data
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.2, random_state=42)
现在,我将尝试安装以下CatBoostClassifier:

from catboost import CatBoostClassifier

cat_features = ['color', 'status']
cb = CatBoostClassifier(iterations=100, random_state=42, eval_metric='F1')
cb.fit(X_train, y_train, cat_features=cat_features, plot=True, eval_set=(X_test, y_test))
我在尝试拟合状态为
AttributeError的模型时收到以下错误:模块“pandas”没有属性“SparseDtype”
。我不确定我是否理解这是指什么或如何纠正问题。任何关于如何解决此错误的反馈都将不胜感激


我正在运行python 3.6.8,目前已安装pandas==0.23.4和catboost==0.24.2。

SparseDtype是pandas版本0.24.0中的新版本。安装了熊猫的最新版本