用 Python 练习机器学习面试题
Lisa Stuart
Data Scientist
测试数据:
Monthly DebtAnnual Income/12| 函数 | 返回 |
|---|---|
sklearn.linear_model.LogisticRegression |
逻辑回归 |
sklearn.model_selection.train_test_split |
训练/测试集切分函数 |
sns.countplot(x='Loan Status', data=data) |
条形图 |
df.drop(['Feature 1', 'Feature 2'], axis=1) |
删除特征列表 |
df["Loan Status"].replace({'Paid': 0, 'Not Paid': 1}) |
将 Loan Status 转为整数 |
pd.get_dummies() |
k - 1 个二进制特征 |
sklearn.metrics.accuracy_score(y_test, predict(X_test)) |
模型准确率 |
用 Python 练习机器学习面试题