relativeimp是一个python包,用于执行关键驱动程序分析并按驱动程序生成相对重要性。

relativeImp的Python项目详细描述


相对重要性计算器

简介

关键驱动因素分析是市场研究中一个流行而强大的工具,可以量化单个驱动因素在预测结果变量方面的相对重要性。例如,市场营销研究人员使用客户体验调查响应进行关键驱动因素分析,以了解哪些方面的客户体验最能驱动客户的总体满意度。

由于驱动因素之间往往高度相关,典型的多元回归分析会产生驱动因素重要性的缺陷指标。相反,我们采用relative weight analysis方法,精确地划分相关驱动程序之间的差异。

相对重要性计算器按驱动程序为指定的结果变量生成原始的和规范化的相对重要性。原始相对重要性之和等于r平方(即结果变量中可由所有驱动因素解释的总变化比例),标准化相对重要性之和等于1。

先决条件

要使用相对重要性计算器,需要安装pandas和numpy。

安装

PyPI

安装相对重要性计算器

pip install relativeImp

输入和输出

相对重要性计算器接受三个必需的输入参数,并返回一个pandas数据框:

输入参数:

df: pandas.core.frame.DataFrame
    Raw input data, e.g. survey responses

outcomeName: str
    Name of the single outcome variable, e.g. overall satisfaction scores

driverNames: list
    Names of the driver variables, e.g. satisfication drivers such as quality, ease of use etc.  

输出:

pandas.core.frame.DataFrame with three columns:
    driver: names of the driver variables
    rawRelaImpt: the raw relative importance whose sum equals R-squared
    normRelaImpt: the normalized relative importance whose sum equals one    

示例代码

importpandasaspdfromrelativeImpimportrelativeImpdf=pd.read_excel("raw_survey_responses.xlsx")yName='Overall Satisfaction'xNames=['Response Time to the Service Call','Efficiency of Handling the Service Call','Answer/Solution Provided','Knowledge of the Service Personnel','Communication Skills of the Service Personnel','Professionalism of the Service Personnel']df_results=relativeImp(df,outcomeName=yName,driverNames=xNames)

创建者

版权所有©2019 Dan Yang

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法使用JAXB配置Moxy   java如何让我的简单Swing telnet客户端正确显示字符?   java中从可运行线程调用主线程的多线程处理   java数据源。EBJ3会话bean中的getConnection()   使用java和正则表达式从xml文件提取值时出现问题   java定制Jersy胡须Mvc   在Java中,“限制并发”是什么意思?   java有没有更干净的方法可以在这里使用Optional,而不在三个地方返回“NA”?   java Tomcat启动,然后崩溃,除非我打电话   java理解客户机和服务器   java时间戳将在视图对象>实体转换期间丢失   如何在java中返回布尔值(基元)?   java使用spring mvc设置日志记录,希望仅对我的代码进行跟踪/调试   用Jackson解析嵌套对象