relativeImp is a Python package to conduct the key driver analysis and generate relative importance by driver.
Project description
Relative Importance Calculator
Introduction
Key driver analysis is a popular and powerful tool in marketing research to quantify the relative importance of individual drivers in predicting an outcome variable. For example, marketing researchers conduct key driver analysis using customer experience survey responses to understand which aspects of the customer experience would drive the customer overall satisfaction the most.
As drivers are often highly correlated with each other, typical multiple regression analysis would produce flawed indicators of driver importance. Instead, we adopt the relative weight analysis approach which accurately partitions variance among the correlated drivers.
The Relative Importance Calculator produces the raw and normalized relative importance by driver for a specified outcome variable. The sum of the raw relative importance equals R-squared (i.e. the total proportion of variation in the outcome variable that can be explained by all the drivers) and the sum of the normalized relative importance equals one.
Prerequisite
To use the Relative Importance Calculator, you need to have pandas and NumPy installed.
Installation
Install the Relative Importance Calculator from PyPI:
pip install relativeImp
Input and Output
The Relative Importance Calculator takes three mandatory input parameters and returns a pandas DataFrame:
**Input Parameters:**
----------
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.
**Output Returns:**
----------
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
Example Code
import pandas as pd
from relativeImp import relativeImp
df = pd.read_excel("raw_survey_responses.xlsx")
outcomeName = 'Overall Satisfaction'
driverNames = ['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, driverNames)
Creator
Copyright © 2019 Dan Yang
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for relativeImp-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c38c5157e91118976321eb7ee9cc02702b75d831ce249b2c946e2675d0e3770f |
|
MD5 | d946eba921f626314a8b047044d3440c |
|
BLAKE2b-256 | 0b189f3648c81364bed6ef4dfa7f2a75fe765859ac1e30f836be7c8375e3e345 |