Data Wrangling (Visualizations)

In [1]:
#Import Statements
%matplotlib inline

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
In [2]:
#importing Final Data found in Data/final Folder

archive = pd.read_csv('data/final/twitter_archive_master.csv',index_col=0)
img = pd.read_csv('data/final/image_predictions.csv', index_col=0)

print("Import Successful")
Import Successful

1. Analysing fav_count from archive

In [3]:
fav_mean = archive.fav_count.mean()
fav_median = archive.fav_count.median()
fav_max = archive.fav_count.max()
fav_sum = archive.fav_count.sum()
In [4]:
archive.fav_count.count()
Out[4]:
2344
In [5]:
print("Mean Favourite Value is : {}".format(fav_mean))
print("Median Favourite Value is : {}".format(fav_median))
print("Max Favourite Value for an tweet is : {}".format(fav_max))
print("Total Favourite secured for All Tweets : {}".format(fav_sum))
Mean Favourite Value is : 8031.052901023891
Median Favourite Value is : 3520.5
Max Favourite Value for an tweet is : 142720
Total Favourite secured for All Tweets : 18824788
In [6]:
fav_plt = archive.fav_count.hist(alpha=0.8,figsize=(8,8))
plt.xlabel("Fav Counts");
plt.ylabel("Count of Tweets");
plt.title("Favorited Tweets");
plt.savefig('Docs/Viz/1.png');

2. Analysing retweet_count from archive

In [7]:
archive
Out[7]:
tweet_id in_reply_to_status_id in_reply_to_user_id timestamp source retweeted_status_id retweeted_status_user_id retweeted_status_timestamp expanded_urls full_text fav_count retweet_count pet_name dog numerator denominator
0 892420643555336193 NaN NaN 2017-08-01 16:23:56 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/892420643... This is Phineas. He's a mystical boy. Only eve... 38625 8541 Phineas NaN 13.0 10
1 892177421306343426 NaN NaN 2017-08-01 00:17:27 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/892177421... This is Tilly. She's just checking pup on you.... 33105 6282 Tilly NaN 13.0 10
2 891815181378084864 NaN NaN 2017-07-31 00:18:03 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/891815181... This is Archie. He is a rare Norwegian Pouncin... 24922 4161 Archie NaN 12.0 10
3 891689557279858688 NaN NaN 2017-07-30 15:58:51 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/891689557... This is Darla. She commenced a snooze mid meal... 42022 8670 Darla NaN 13.0 10
4 891327558926688256 NaN NaN 2017-07-29 16:00:24 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/891327558... This is Franklin. He would like you to stop ca... 40172 9422 Franklin NaN 12.0 10
5 891087950875897856 NaN NaN 2017-07-29 00:08:17 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/891087950... Here we have a majestic great white breaching ... 20140 3118 coast NaN 13.0 10
6 890971913173991426 NaN NaN 2017-07-28 16:27:12 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://gofundme.com/ydvmve-surgery-for-jax,ht... Meet Jax. He enjoys ice cream so much he gets ... 11807 2076 Jax NaN 13.0 10
7 890729181411237888 NaN NaN 2017-07-28 00:22:40 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/890729181... When you watch your owner call another dog a g... 65260 18929 boy NaN 13.0 10
8 890609185150312448 NaN NaN 2017-07-27 16:25:51 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/890609185... This is Zoey. She doesn't want to be one of th... 27682 4275 Zoey NaN 13.0 10
9 890240255349198849 NaN NaN 2017-07-26 15:59:51 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/890240255... This is Cassie. She is a college pup. Studying... 31823 7434 Cassie doggo 14.0 10
10 890006608113172480 NaN NaN 2017-07-26 00:31:25 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/890006608... This is Koda. He is a South Australian decksha... 30563 7353 Koda NaN 13.0 10
11 889880896479866881 NaN NaN 2017-07-25 16:11:53 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/889880896... This is Bruno. He is a service shark. Only get... 27679 4980 Bruno NaN 13.0 10
12 889665388333682689 NaN NaN 2017-07-25 01:55:32 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/889665388... Here's a puppo that seems to be on the fence a... 47935 10083 her puppo 13.0 10
13 889638837579907072 NaN NaN 2017-07-25 00:10:02 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/889638837... This is Ted. He does his best. Sometimes that'... 27070 4551 Ted NaN 12.0 10
14 889531135344209921 NaN NaN 2017-07-24 17:02:04 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/889531135... This is Stuart. He's sporting his favorite fan... 15040 2241 Stuart puppo 13.0 10
15 889278841981685760 NaN NaN 2017-07-24 00:19:32 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/889278841... This is Oliver. You're witnessing one of his m... 25190 5430 Oliver NaN 13.0 10
16 888917238123831296 NaN NaN 2017-07-23 00:22:39 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/888917238... This is Jim. He found a fren. Taught him how t... 28972 4508 Jim NaN 12.0 10
17 888804989199671297 NaN NaN 2017-07-22 16:56:37 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/888804989... This is Zeke. He has a new stick. Very proud o... 25482 4353 Zeke NaN 13.0 10
18 888554962724278272 NaN NaN 2017-07-22 00:23:06 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/888554962... This is Ralphus. He's powering up. Attempting ... 19824 3588 Ralphus NaN 13.0 10
19 888078434458587136 NaN NaN 2017-07-20 16:49:33 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/888078434... This is Gerald. He was just told he didn't get... 21677 3500 Gerald NaN 12.0 10
20 887705289381826560 NaN NaN 2017-07-19 16:06:48 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/887705289... This is Jeffrey. He has a monopoly on the pool... 30067 5405 Jeffrey NaN 13.0 10
21 887517139158093824 NaN NaN 2017-07-19 03:39:09 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/887517139... I've yet to rate a Venezuelan Hover Wiener. Th... 46065 11693 Wiener NaN 14.0 10
22 887473957103951883 NaN NaN 2017-07-19 00:47:34 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/887473957... This is Canela. She attempted some fancy porch... 68851 18259 Canela NaN 13.0 10
23 887343217045368832 NaN NaN 2017-07-18 16:08:03 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/887343217... You may not have known you needed to see this ... 33548 10422 today NaN 13.0 10
24 887101392804085760 NaN NaN 2017-07-18 00:07:08 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/887101392... This... is a Jubilant Antarctic House Bear. We... 30425 5975 This NaN 12.0 10
25 886983233522544640 NaN NaN 2017-07-17 16:17:36 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/886983233... This is Maya. She's very shy. Rarely leaves he... 35026 7791 Maya NaN 13.0 10
26 886736880519319552 NaN NaN 2017-07-16 23:58:41 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://www.gofundme.com/mingusneedsus,https:/... This is Mingus. He's a wonderful father to his... 12015 3302 Mingus NaN 13.0 10
27 886680336477933568 NaN NaN 2017-07-16 20:14:00 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/886680336... This is Derek. He's late for a dog meeting. 13... 22325 4477 Derek NaN 13.0 10
28 886366144734445568 NaN NaN 2017-07-15 23:25:31 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN https://twitter.com/dog_rates/status/886366144... This is Roscoe. Another pupper fallen victim t... 21112 3203 Roscoe pupper 12.0 10
29 886267009285017600 8.862664e+17 2.281182e+09 2017-07-15 16:51:35 +0000 <a href="http://twitter.com/download/iphone" r... NaN NaN NaN NaN @NonWhiteHat @MayhewMayhem omg hello tanner yo... 116 4 caution NaN 12.0 10
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2314 775898661951791106 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: Like father (doggo), like son (... 0 17240 (pupper) doggo 12.0 10
2315 773336787167145985 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: Meet Fizz. She thinks love is a... 0 5675 Fizz NaN 11.0 10
2316 772615324260794368 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is Gromit. He's pupset bec... 0 3743 Gromit NaN 10.0 10
2317 771171053431250945 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is Frankie. He's wearing b... 0 8399 Frankie NaN 11.0 10
2318 771004394259247104 NaN NaN NaN NaN NaN NaN NaN NaN RT @katieornah: @dog_rates learning a lot at c... 0 245 https://t pupper 12.0 10
2319 770743923962707968 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: Here's a doggo blowing bubbles.... 0 50572 bubbles doggo 13.0 10
2320 770093767776997377 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is just downright precious... 0 3374 af doggo 12.0 10
2321 769335591808995329 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: Ever seen a dog pet another dog... 0 8523 scene NaN 13.0 10
2322 768909767477751808 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: When it's Janet from accounting... 0 3004 chocolate pupper 10.0 10
2323 768554158521745409 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is Nollie. She's waving at... 0 6462 Nollie NaN 12.0 10
2324 766864461642756096 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: We only rate dogs... this is a ... 0 6284 dogs NaN 10.0 10
2325 766078092750233600 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is Colby. He's currently r... 0 2873 Colby NaN 12.0 10
2326 763167063695355904 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: Meet Eve. She's a raging alcoho... 0 3348 Eve pupper 8.0 10
2327 761750502866649088 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: "Tristan do not speak to me wit... 0 4373 Xbox NaN 10.0 10
2328 761371037149827077 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: Oh. My. God. 13/10 magical af h... 0 19821 Oh NaN 13.0 10
2329 760153949710192640 NaN NaN NaN NaN NaN NaN NaN NaN RT @hownottodraw: The story/person behind @dog... 0 36 af NaN 11.0 10
2330 759566828574212096 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This... is a Tyrannosaurus rex.... 0 23398 This NaN 10.0 10
2331 759159934323924993 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: AT DAWN...\r\r\nWE RIDE\r\r\n\r... 0 1297 DAWN NaN 11.0 10
2332 757729163776290825 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is Chompsky. He lives up t... 0 8952 Chompsky NaN 11.0 10
2333 757597904299253760 NaN NaN NaN NaN NaN NaN NaN NaN RT @jon_hill987: @dog_rates There is a cunning... 0 322 least pupper 11.0 10
2334 754874841593970688 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is Rubio. He has too much ... 0 8840 Rubio NaN 11.0 10
2335 753298634498793472 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is Carly. She's actually 2... 0 6368 Carly NaN 12.0 10
2336 752701944171524096 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: HEY PUP WHAT'S THE PART OF THE ... 0 3178 https://t NaN 11.0 10
2337 752309394570878976 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: Everyone needs to watch this. 1... 0 18361 this NaN 13.0 10
2338 747242308580548608 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This pupper killed this great w... 0 3158 battle pupper 13.0 10
2339 746521445350707200 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: This is Shaggy. He knows exactl... 0 1076 Shaggy NaN 10.0 10
2340 743835915802583040 NaN NaN NaN NaN NaN NaN NaN NaN RT @dog_rates: Extremely intelligent dog here.... 0 2289 here NaN 10.0 10
2341 711998809858043904 NaN NaN NaN NaN NaN NaN NaN NaN RT @twitter: @dog_rates Awesome Tweet! 12/10. ... 0 136 12/10 NaN 12.0 10
2342 667550904950915073 NaN NaN NaN NaN NaN NaN NaN NaN RT @dogratingrating: Exceptional talent. Origi... 0 35 talent NaN 12.0 10
2343 667550882905632768 NaN NaN NaN NaN NaN NaN NaN NaN RT @dogratingrating: Unoriginal idea. Blatant ... 0 33 idea NaN -5.0 10

2344 rows × 16 columns

In [8]:
ass = np.sort(archive.retweet_count)[::-1]
In [9]:
ass
Out[9]:
array([76934, 60743, 50572, ...,     2,     2,     0], dtype=int64)
In [10]:
retweet_mean = archive.retweet_count.mean()
retweet_median = archive.retweet_count.median()
retweet_max = archive.retweet_count.max()
retweet_sum = archive.retweet_count.sum()
In [11]:
archive.retweet_count.hist(alpha=0.8,figsize=(8,8),color = "green")
plt.xlabel("Retweet Counts");
plt.ylabel("Count of Tweets");
plt.title("Re-Tweeted Tweets");
plt.savefig('Docs/Viz/2.png');
In [12]:
print("Mean Retweets Value is : {}".format(retweet_mean))
print("Median Retweets Value is : {}".format(retweet_median))
print("Max Retweets Value for an tweet is : {}".format(retweet_max))
print("Total Retweets secured for All Tweets : {}".format(retweet_sum))
Mean Retweets Value is : 3006.8877986348125
Median Retweets Value is : 1400.5
Max Retweets Value for an tweet is : 76934
Total Retweets secured for All Tweets : 7048145

3. Analysing Dog Names from archive

In [13]:
pie = archive.dog.value_counts()
pie.plot(kind="pie");
plt.savefig('Docs/Viz/3.png');
In [14]:
dog_val = archive.dog.value_counts()


name_sum = dog_val[0]+dog_val[1]+dog_val[2]+dog_val[3]
pupper_per = (dog_val[0]/name_sum)*100
doggo_per = (dog_val[1]/name_sum)*100
puppo_per = (dog_val[2]/name_sum)*100
floofer_per = (dog_val[3]/name_sum)*100

print("The Percentile Value of Pupper to all dogs is {}%".format(pupper_per))
print("The Percentile Value of Doggo to all dogs is {}%".format(doggo_per))
print("The Percentile Value of Puppo to all dogs is {}%".format(puppo_per))
print("The Percentile Value of Floofer to all dogs is {}%".format(floofer_per))
The Percentile Value of Pupper to all dogs is 65.57788944723619%
The Percentile Value of Doggo to all dogs is 24.623115577889447%
The Percentile Value of Puppo to all dogs is 8.793969849246231%
The Percentile Value of Floofer to all dogs is 1.0050251256281406%
In [15]:
dog_val.sum()
Out[15]:
398

4. Analysing numerators & denominators from archive

In [16]:
num = archive.numerator
dom = archive.denominator

num_mean = num.mean()
num_median = num.median()
num_max = archive.numerator.max()

dom_mean = dom.mean()
dom_median = dom.median()
In [17]:
print("The mean value of all the numerator of the ratings given is : {}".format(num_mean))
print("The median value of all the numerator of the ratings given is : {}".format(num_median))
print("The mean value of all the denominators of the ratings given is : {}".format(dom_mean))
print("The median value of all the denominators of the ratings given is : {}".format(dom_median))
print("".format())
The mean value of all the numerator of the ratings given is : 11.125853242320819
The median value of all the numerator of the ratings given is : 11.0
The mean value of all the denominators of the ratings given is : 10.196245733788396
The median value of all the denominators of the ratings given is : 10.0

In [18]:
num_plt = num.plot(figsize=(10,10), kind='hist', color="#ff9960");
plt.ylabel("Tweets")
plt.xlabel("Numerator Values")
plt.title("Numerator Histogram");
# num_plt.axes.get_yaxis().set_visible(False)

plt.savefig('Docs/Viz/4.png');
In [19]:
print("The Maximum Rating Numerator given is {}".format(num_max))
The Maximum Rating Numerator given is 99.0

#5 Finding out about the posting habits

In [20]:
time_dt = pd.to_datetime(archive.timestamp).dt.date
time_hr = pd.to_datetime(archive.timestamp).dt.hour
time_yr = pd.to_datetime(archive.timestamp).dt.year
In [21]:
time_hr.value_counts()
time_hr.plot(figsize=(8,6), kind='hist');
plt.title("Hourly Posting Graph");
plt.savefig('Docs/Viz/5.png');
In [22]:
time_dt = time_dt.value_counts()
time_dt.plot(figsize=(15,10));
plt.title("Daily Posting Graph");
plt.savefig('Docs/Viz/6.png');
In [23]:
time_dt.value_counts()
Out[23]:
2     174
1     138
3     119
4      53
5      24
7      22
6      20
8       6
10      6
21      4
18      4
17      4
9       4
16      3
14      3
13      3
26      2
11      2
15      2
20      2
25      1
23      1
24      1
12      1
Name: timestamp, dtype: int64
In [24]:
time_yr.value_counts().plot(kind='bar');
plt.title("Yearly Graph Figure");
plt.savefig('Docs/Viz/7.png');

Analyzing the img DataSet

In [25]:
#Viewing The DataSet
img.head()
Out[25]:
tweet_id jpg_url img_num p1 p1_conf p1_dog p2 p2_conf p2_dog p3 p3_conf p3_dog
0 666020888022790149 https://pbs.twimg.com/media/CT4udn0WwAA0aMy.jpg 1 Welsh springer spaniel 0.465074 True collie 0.156665 True Shetland sheepdog 0.061428 True
1 666029285002620928 https://pbs.twimg.com/media/CT42GRgUYAA5iDo.jpg 1 redbone 0.506826 True miniature pinscher 0.074192 True Rhodesian ridgeback 0.072010 True
2 666033412701032449 https://pbs.twimg.com/media/CT4521TWwAEvMyu.jpg 1 German shepherd 0.596461 True malinois 0.138584 True bloodhound 0.116197 True
3 666044226329800704 https://pbs.twimg.com/media/CT5Dr8HUEAA-lEu.jpg 1 Rhodesian ridgeback 0.408143 True redbone 0.360687 True miniature pinscher 0.222752 True
4 666049248165822465 https://pbs.twimg.com/media/CT5IQmsXIAAKY4A.jpg 1 miniature pinscher 0.560311 True Rottweiler 0.243682 True Doberman 0.154629 True

#6 Calculating the mean values for the images uploaded per post from img

In [26]:
#Calulating the mean values for the images uploaded per post
img_uploaded_mean = img.img_num.mean()
img_uploaded_median = img.img_num.median()
In [27]:
print("The Average amount of pictures uploaded per tweet is : {}".format(img_uploaded_mean))
print("The Median amount of the uploaded photos is : {}".format(img_uploaded_median))
The Average amount of pictures uploaded per tweet is : 1.214734437464306
The Median amount of the uploaded photos is : 1.0

Neural Network Analysis

  • We can gauge the efficiency of the algorithm by seeing it's prediction strength.
  • This is a value from 0.00 to 0.99(or 1)
  • Each phase of the neural analysis (p1_conf, p2_conf, p3_conf) has a hit ratio and we can gauge a lot about the network works.

#7 Finding the efficiency of the Prediction inp1_conf,p2_conf & p3_conf

In [28]:
# Calulating the mean values for the  confidence prediction varibles 
Cp1_mean = img.p1_conf.mean()
Cp2_mean = img.p2_conf.mean()
Cp3_mean = img.p3_conf.mean()
In [29]:
print("Calculating the Efficiency  of the Neural Network on the diffrent stages p1,p2,p3")
print("The Average Efficiency  of Stage one P1 {} ".format(Cp1_mean))
print("The Average Efficiency  of Stage one P2 {} ".format(Cp2_mean))
print("The Average Efficiency  of Stage one P3 {} ".format(Cp3_mean))
Calculating the Effencincy of the Neural Network on the diffrent stages p1,p2,p3
The Average Effeicincy of Stage one P1 0.6042066042261568 
The Average Effeicincy of Stage one P2 0.1377151198694462 
The Average Effeicincy of Stage one P3 0.06161188353832655 

#8 Finding Hit rate of the neural network through the different stages

In [30]:
#using counts to get true false valuses of the data
prediction_p1 = img.p1_dog.value_counts()
prediction_p2 = img.p2_dog.value_counts()
prediction_p3 = img.p3_dog.value_counts()

#Finding percentile values of each
p1_per = prediction_p1[1]/ (prediction_p1[0]+prediction_p1[1])*100
p2_per = prediction_p2[1]/ (prediction_p2[0]+prediction_p2[1])*100
p3_per = prediction_p3[1]/ (prediction_p3[0]+prediction_p3[1])*100
In [35]:
#Printing Above found percentiles.
print("P1 Stage Success Hit Rate is {} %".format(p1_per))
print("P2 Stage Success Hit Rate is {} %".format(p2_per))
print("P3 Stage Success Hit Rate is {} %".format(p3_per))
P1 Stage Success Hit Rate is 87.49286122215877 %
P2 Stage Success Hit Rate is 88.692175899486 %
P3 Stage Success Hit Rate is 85.6082238720731 %
In [32]:
#Anaylzing which dogs are the most popular through diffrent stages of the neural network.
d_p1 = img.p1.value_counts()
d_p2 = img.p2.value_counts()
d_p3 = img.p3.value_counts()
In [33]:
#Dumping the Data to Read and Anaylyze
print("Finding out the most popular Dogs for Each Stage \n")
#print("P1")
print("The Top Popular Dogs for Stage P1 Are :\n{}  \n".format(d_p1.head()))
#print("P2")
print("The Top Popular Dogs for Stage P2 Are :\n{}  \n".format(d_p2.head()))
#print("P3")
print("The Top Popular Dogs for Stage P3 Are :\n{}  \n".format(d_p3.head()))
Finding out the most popular Dogs for Each Stage 

The Top Popular Dogs for Stage P1 Are :
golden retriever      150
Labrador retriever    100
Pembroke               89
Chihuahua              83
pug                    57
Name: p1, dtype: int64  

The Top Popular Dogs for Stage P2 Are :
Labrador retriever    104
golden retriever       92
Cardigan               73
Chihuahua              44
Pomeranian             42
Name: p2, dtype: int64  

The Top Popular Dogs for Stage P3 Are :
Labrador retriever    79
Chihuahua             58
golden retriever      48
Eskimo dog            38
kelpie                35
Name: p3, dtype: int64  

In [36]:
# Merging all the Data into one Series so i can get a better picutre for joint anaylysis
all_dogs = pd.concat([d_p1, d_p2, d_p3])
d_all = all_dogs.groupby(all_dogs.index).aggregate(sum)
d_all = d_all.sort_values(ascending=False)
print("The Top 10 Dogs overall through all the stages in our DataSet are \n\n{}\n".format(d_all.head(10)))
The Top 10 Dogs overall through all the stages in our DataSet are 

golden retriever      290
Labrador retriever    283
Chihuahua             185
Pembroke              143
Cardigan              115
Pomeranian            109
toy poodle            105
pug                    97
chow                   96
cocker spaniel         95
dtype: int64

In [ ]:

In [ ]: