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比较空对象   JavasocketUDP循环   更改活动时使用java“安卓.view.InflateException:二进制XM文件行”   java可以在EclipseRCP中定义ViewPart或Workbench的最小大小吗?   java试图根据用户输入对列表中的整数进行排序   java如何避免Hibernate在oneToMany关系上创建外键限制   java创建一个简单的字符串解析器,交互式外壳式   java如何解析JSON并将其值转换为数组?   JavaAzure:Image Magick提供0 KB的输出?   使用Azure Event Hubs for Apache Kafka生态系统和OAuth在Java中发送和接收消息   java如何将Oracle的Interval数据类型格式化为HH:MM格式?   java jsoup无法在安卓上正确解析HTML   java如何计算2ndArray中的距离?   java Swing Worker线程说在超类中没有Process()方法   带有内部组件的java单击JPanel   javajsp中的html引号转义   java Maven在打包jar时无法检索buildNumber   Java中的linux八进制转义导致错误的字节值,编码问题?