исправь код, чтоб не было ошибки
92: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  X = os_data_X[sign_tokens].replace(False, 0, inplace=False).replace(True, 1, inplace=False)
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
import seaborn as sns
from imblearn.over_sampling import SMOTE
import statsmodels.api as sm
from sklearn.feature_selection import RFE
from sklearn.metrics import confusion_matrix, classification_report, roc_auc_score, roc_curve

# Загрузка данных
data = pd.read_csv('banking.csv', header=0).dropna()
print(data.shape)
print(list(data.columns))
print(data['education'].unique())

# Группировка образования
data['education'] = np.where(data['education'].isin(['basic.4y', 'basic.6y', 'basic.9y']), 'Basic', data['education'])

# Автоматизированный анализ данных
print(data['y'].value_counts())
count_no_sub = len(data[data['y'] == 0])
count_sub = len(data[data['y'] == 1])
pct_of_no_sub = count_no_sub / (count_no_sub + count_sub)
pct_of_sub = count_sub / (count_no_sub + count_sub)
print("Percentage of no subscription is", pct_of_no_sub * 100)
print("Percentage of subscription", pct_of_sub * 100)
sns.countplot(x='y', data=data, palette='hls', hue='y', legend=False)
plt.show()

# Создание бинарных переменных
cat_vars = ['job', 'marital', 'education', 'default', 'housing', 'loan', 'contact', 'month', 'day_of_week', 'poutcome']
for var in cat_vars:
    cat_list = pd.get_dummies(data[var], prefix=var)
    data = data.join(cat_list)

# Итоговые переменные
cat_vars = ['job', 'marital', 'education', 'default', 'housing', 'loan', 'contact', 'month', 'day_of_week', 'poutcome']
data_vars = data.columns.values.tolist()
to_keep = [i for i in data_vars if i not in cat_vars]
data_final = data[to_keep]
print(data_final.columns.values)

# Балансировка датасета
X = data_final.loc[:, data_final.columns != 'y']
y = data_final.loc[:, data_final.columns == 'y']
os = SMOTE(random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0)
columns = X_train.columns
os_data_X, os_data_y = os.fit_resample(X_train, y_train)
os_data_X = pd.DataFrame(data=os_data_X, columns=columns)
os_data_y = pd.DataFrame(data=os_data_y, columns=['y'])
print("Length of oversampled data is ", len(os_data_X))
print("Number of no subscription in oversampled data", len(os_data_y[os_data_y['y'] == 0]))
print("Number of subscription", len(os_data_y[os_data_y['y'] == 1]))
print("Proportion of no subscription data in oversampled data is ", len(os_data_y[os_data_y['y'] == 0]) / len(os_data_X))
print("Proportion of subscription data in oversampled data is ", len(os_data_y[os_data_y['y'] == 1]) / len(os_data_X))

# Создание модели логистической регрессии
logreg = LogisticRegression(max_iter=1000)

# Отбор значимых признаков
rfe = RFE(estimator=logreg, n_features_to_select=20, step=0.9999)
rfe.fit(os_data_X, os_data_y.values.ravel())

# Получение отобранных признаков
N = rfe.n_features_
print("Number of selected features: ", N)
sign_tokens = [X.columns[i] for i, val in enumerate(rfe.support_) if val]
print("Significant features: ", sign_tokens)


# Преобразование значимых признаков в 0 и 1
X = os_data_X[sign_tokens].replace(False, 0, inplace=False).replace(True, 1, inplace=False)
y = os_data_y['y']

# Построение логистической регрессии
logit_model = sm.Logit(y, X)
result = logit_model.fit()
print(result.summary2())

# Удаление лишних признаков
sign_tokens.remove('day_of_week_mon')
sign_tokens.remove('day_of_week_tue')
sign_tokens.remove('day_of_week_wed')
sign_tokens.remove('day_of_week_thu')
sign_tokens.remove('day_of_week_fri')

# Повторное построение модели
X = os_data_X[sign_tokens].replace(False, 0, inplace=False).replace(True, 1, inplace=False)
logit_model = sm.Logit(y, X)
result = logit_model.fit()
print(result.summary2())
# Обучение модели
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0)
logreg = LogisticRegression(max_iter=2000)  # Увеличение количества итераций
logreg.fit(X_train, y_train)

# Точность модели
y_pred = logreg.predict(X_test)
print('Accuracy of classifier on test set: {:.2f}'.format(logreg.score(X_test, y_test)))

# Матрица ошибок и отчет о классификации
conf_matrix = confusion_matrix(y_test, y_pred)
print(conf_matrix)
print(classification_report(y_test, y_pred))

# ROC-кривая
logit_roc_auc = roc_auc_score(y_test, logreg.predict(X_test))
fpr, tpr, thresholds = roc_curve(y_test, logreg.predict_proba(X_test)[:,1])
plt.figure()
plt.plot(fpr, tpr, label='Logistic Regression (area = %0.2f)' % logit_roc_auc)
plt.plot([0, 1], [0, 1],'r--')
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title('Receiver operating characteristic')
plt.legend(loc="lower right")
plt.savefig('Log_ROC')
plt.show()

# Графики
pd.crosstab(data['job'], data['y']).plot(kind='bar')
plt.title('Frequency of Purchase for Job Title')
plt.xlabel('Job')
plt.ylabel('Frequency of Purchase')

pd.crosstab(data['marital'], data['y']).plot(kind='bar', stacked=True)
plt.title('Frequency of Purchase for Marital Status')
plt.xlabel('Marital Status')
plt.ylabel('Frequency of Purchase')

pd.crosstab(data['education'], data['y']).plot(kind='bar', stacked=True)
plt.title('Frequency of Purchase for Education Level')
plt.xlabel('Education Level')
plt.ylabel('Frequency of Purchase')

pd.crosstab(data['day_of_week'], data['y']).plot(kind='bar')
plt.title('Frequency of Purchase for Day of Week')
plt.xlabel('Day of Week')
plt.ylabel('Frequency of Purchase')

pd.crosstab(data['month'], data['y']).plot(kind='bar')
plt.title('Frequency of Purchase for Month')
plt.xlabel('Month')
plt.ylabel('Frequency of Purchase')

data['age'].hist()
plt.title('Frequency of Purchase for Age')
plt.xlabel('Age')
plt.ylabel('Frequency of Purchase')

pd.crosstab(data['poutcome'], data['y']).plot(kind='bar')
plt.title('Frequency of Purchase for Previous Marketing Campaign Outcome')
plt.xlabel('Previous Marketing Campaign Outcome')
plt.ylabel('Frequency of Purchase')

plt.show()