Difference between revisions of "APA Feature Engineering"

From Analytics Practicum
Jump to navigation Jump to search
(email exchange ratio changed)
Line 48: Line 48:
  
 
'''Email Exchange Ratio:'''<br>
 
'''Email Exchange Ratio:'''<br>
This metric will show the number of emails exchanged between the two employees as a ratio of the total number of emails exchanged by these employees.  
+
This feature is used to show the frequency of information exchanged between any two employees. It is used to check the number of emails exchanged between two employees to show how much they interact, collaborate, and share information. The formula used for this feature is:
We assume more information is being exchanged with larger email size. <br>
+
<br><br>
<div>
 
 
<div style="border:1px solid rgb(85,198,225); -moz-border-radius:15px;width:250px;padding:10px;text-align: center;">
 
<div style="border:1px solid rgb(85,198,225); -moz-border-radius:15px;width:250px;padding:10px;text-align: center;">
 
[[Image:EmailExchangeRatioFormula.PNG|200px]] <br>
 
[[Image:EmailExchangeRatioFormula.PNG|200px]] <br>
Line 56: Line 55:
 
𝑁𝑎: Number of emails sent by A <br>
 
𝑁𝑎: Number of emails sent by A <br>
 
𝑁𝑏:Number of emails sent by B
 
𝑁𝑏:Number of emails sent by B
</div>
+
</div><br>
[[Image:EmailExchangeRatioSQL.png|600px]]
+
The email data is imported into phpmyadmin and SQL is used to apply the above formula onto the data to get proper output. The SQL statement used to apply this formula is given below:<br><br>
</div>
+
<font face="Courier New">select t1.employee1, t1.employee2, (t1.total/(IFNULL(t2.total,0) + IFNULL(t3.total,0) - t1.total)) as EmailExchangedRatio from
 +
(select least(`Remote`,`Local`) as employee1, greatest(`Remote`,`Local`) as employee2, count(*) as total from midterm group by least(`Remote`,`Local`), greatest(`Remote`,`Local`)) as t1
 +
 
 +
left join (select `Local` as employee, count(*) as total from midterm group by `Local`) as t2 on t2.employee = t1.employee1
 +
 
 +
left join (select `Local` as employee, count(*) as total from midterm group by `Local`) as t3 on t3.employee = t1.employee2;</font>
 +
<br><br>
 +
In this SQL statement, ‘Local’ is the sender of the email while ‘Remote’ is the receiver of the email. A part of the results is shown in the table 5 below:
 +
<br><br>
 
[[Image:EmailExchangeRatioResults.jpg|400px]]
 
[[Image:EmailExchangeRatioResults.jpg|400px]]
 
<br><br>
 
<br><br>

Revision as of 14:08, 22 April 2017

APA logo.png

HOME

 

PROJECT OVERVIEW

 

METHODOLOGY

 

PROJECT MANAGEMENT

 

DOCUMENTATION

 

FEATURE ENGINEERING

 

OTHER PROJECTS

 


FeatureEngg.PNG




Subject Line weightage: We will be using subject line weightage as one of the components in determining how important and relevant a single email exchange is to the business. Our approach will be as follows:

  1. First run an analysis on all the terms occurring in the entire dataset
  • This analysis will filter out common words, prepositions and other unimportant words that could potentially skew the results.
  • The analysis will return a listen of words along with the frequency of the term’s occurrence in the dataset.
  1. Based on the results obtained, we would like to calculate the tf-idf of each term.
  • tf: how often does the term occur in the document
  • idf: how often does the term occur in other documents
  • tf-idf will allow us to find the most important terms in the set of documents
  1. Using the value of this tf-idf, we will assign each term a weightage based on how important it is in determining the importance to the business
  2. Each subject line of an email will then have an aggregated weightage of the terms appearing in itself.


Subjectlineweightagescreenshot.jpg

Email Exchange Ratio:
This feature is used to show the frequency of information exchanged between any two employees. It is used to check the number of emails exchanged between two employees to show how much they interact, collaborate, and share information. The formula used for this feature is:

EmailExchangeRatioFormula.PNG
𝑁𝑎𝑏: Number of emails exchanged between A and B
𝑁𝑎: Number of emails sent by A
𝑁𝑏:Number of emails sent by B


The email data is imported into phpmyadmin and SQL is used to apply the above formula onto the data to get proper output. The SQL statement used to apply this formula is given below:

select t1.employee1, t1.employee2, (t1.total/(IFNULL(t2.total,0) + IFNULL(t3.total,0) - t1.total)) as EmailExchangedRatio from (select least(`Remote`,`Local`) as employee1, greatest(`Remote`,`Local`) as employee2, count(*) as total from midterm group by least(`Remote`,`Local`), greatest(`Remote`,`Local`)) as t1

left join (select `Local` as employee, count(*) as total from midterm group by `Local`) as t2 on t2.employee = t1.employee1

left join (select `Local` as employee, count(*) as total from midterm group by `Local`) as t3 on t3.employee = t1.employee2;

In this SQL statement, ‘Local’ is the sender of the email while ‘Remote’ is the receiver of the email. A part of the results is shown in the table 5 below:

EmailExchangeRatioResults.jpg

Average Email Exchange Size:
This metric takes the average of email sizes of all the emails exchanged between two employees A and B.
EmailexSizeFormula.PNG
EmailexSizeSQL.png
EmailexSizeResults.png

Email Chain Ratio:
This metric reveals the uniqueness of the communications between two employees by considering number of unique subject lines along with frequency of emails exchanged. This shows the number of unique conversations taking place between the employees.

EmailChainRatioFormula.PNG
EmailChainRatioSQL.PNG
EmailChainRatioResults.PNG

Rate of exchange of emails:
This metric shows how often emails are exchanged between two employees, in other words, it helps us understand the regularity of email exchange.
RateOfExchangeFormula.PNG
RateOfExchangeSQL.PNG
RateOfExchangeResults.PNG