在 Python 中基于 customer_churn 数据集建立逻辑回归模型:因变量 Churn,自变量 MonthlyCharges,并计算 log_loss。
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公司面试中。
难度: hard
分类: 机器学习实战, 逻辑回归, 模型评估
标签: python, sklearn, log_loss, logistic regression
参考答案摘要
核心答案 步骤包括:读取数据、拆分 X/y、训练测试划分、训练模型、预测概率、计算 log_loss。 customer_churn=pd.read_csv("customer_churn.csv") customer_churn.head() x=pd.Dataframe(customer_churn['MonthlyCharges']) y=customer_churn[' Churn'] f...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。