在 Python 中使用客户流失数据集构建逻辑回归模型,并计算对数损失。
Build a logistic regression model on the ‘customer_churn’ dataset in Python. The dependent variable is ‘Churn’ and the independent variable is ‘MonthlyCharges.’ Find the log loss of the model.
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: medium
分类: Machine Learning
参考答案摘要
答案 首先读取数据集,并查看数据的前几行以确认字段与格式。 接着将因变量与自变量分别拆分出来,构建逻辑回归模型。 最后使用对数损失指标对模型进行评估,并输出对数损失的数值。 customer_churn=pd.read_csv("customer_churn.csv") customer_churn.head() x=pd.DataFrame(customer_churn[...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。