Dashboard Analysis: Google Fit

This post is to understand the various aspects of the user interface of a web based dashboard. This is an attempt to understand the little details and insights a dashboard can provide visually. This would help to increase the knowledge on the dashboard design and development. The Analysis is AS I SEE IT.

This dashboard indicates excellent design using Material Design concepts using Paper-cards. This also happens to be good example of gamification for maintaining good health. The data is obtained from Android mobile phones with Accelerometer sensors data integeration.

As soon as you login you will see the given dashboard, which will give the following insights.

  1. How much you have walked against the goal. Goals Vs Achieved
  2. Against the goal how much is each activity contributes is given in circle with different color indicators.
  3. Data in different Unit of measurements on a given day such as Minutes, Distance, Calories & Steps
  4. Also list of recent activities ordered by date combined with the activity is provided as well.
  5. Personal records shows the key achievements.
  6. Distance travelled in terms of summary is provided as well.

Dashboard across periods:

  • If we look further down it has facility to analyse data on Day, Week and Month.
  • You can also analyse the data in Time, Steps, Distance, Calories, Heart Rate and Weight
  • The data can also be filtered based on the various activities such as Walk, Running, Cycling, etc.,

Dashboard over a monthly calendar:

  • Here the maximum activity flagged nicely.
  • The activity summary is mentioned over a line bar
  • The current date is displayed in a different color for identification of current date
  • The weekly total is provided on the extreme right over the respective weeks

Step by Step to access wikipedia dump using MongoDB and PHP for data analytics

In an effort to evaluate how to handle unstructured data using mongodb I write this post to extract data from WikiDump and importing to Mongodb and accessing the same using PHP MongoDB Client libraries. Subsequently to do behavior analytics on the data.

Objective: Retrieve the wikidump import it into mongodb and retrieve the data using mongoclient.

Pre-Requisites: We would need the following softwares are pre-requisites for going step by step as per the post.

Step by Step Procedure: Importing the Tamil Wikipedia Dump to MongoDb.

Step 1: First you can download the wikipedia dump from the website dumps.wikipedia.org. In this case I downloaded the Tamil wiki dump from the following location http://dumps.wikimedia.org/tawiki/20131204/

Step 2: Then I would like to analyze the articles in the Tamil wikipedia so downloaded the file tawiki-20131204-pages-articles.xml.bz2 which is of 68.5 MB size

Step 3: You would also need the appropriate library for handling mongoclient and bzopen libraries. Please download those and use it accordingly.

Step 3a: MongoClient Library installation: http://www.php.net/manual/en/mongo.installation.php and look at the s3 amazon link location I downloaded php_mongo-1.4.5.zip.

Note: Extract that zip file and download appropriate version dll to the ext folder of php location. Make sure to add extension=php_mongo-1.4.5-5.4-vc9-x86_64.dll to php.ini ( I was running this in 64-bit os, choose appropariately)

Step 3b: BZip Installation: http://www.bzip.org/ and refer this link http://www.php.net/manual/en/bzip2.setup.php for setting up of the BZip library in PHP.


a. BZip2.dll has to be copied from the BZip installation folder to php folder, refer the picture given below).

b. Make sure to add extension=php_bz2.dll to php.ini or uncomment the same if it exists.

Step 4: Make sure you are running mongodb using the command line interface as shown in the picture below:

Step 5: Enough of setup, now it’s time to import the data from the wikidump to the mongodb. Please follow the instructions on executing the PHP file for importing from the command line. We will use the PHP code from James Linden from the URL provided here http://jameslinden.com/dataset/wikipedia.org/xml-dump-import-mongodb/.

Download the PHP script and place it under WAMP/XAMPP folder accordingly. Make sure you change the $dsname = ‘mongodb://localhost/wp20130708’;
$file = ‘enwiki-20130708-pages-articles.xml.bz2’;
$log = ‘./’;

aspects in the PHP Script. Then go to the command prompt and give the command PHP wikipedia.org-xmldump-mongodb.php.

I’m running the file from PHPScript folder but executing the PHP bin folder. This will also create a log file while the execution is complete.

Step 6: We will verify the imported data using the client mongo

Step 7: The following PHP Code helps to connect to the mongodb which has the wikidump

The following is the code which has modified:


<meta http-equiv=”content-type” content=”text/html;charset=utf-8″ />


// PHP code to look at the Wikipedia data which are imported from Wikipedia Dump to MongoDB

$dbhost = ‘mongodb://localhost/tawiki’;

$dbname = “tawiki”;

//Connect to the localhost

$m = new mongoclient($dbhost);

//Retrive the collections exists in the database “tawiki”

$db = $m->selectDB(“tawiki”);


//Display the Collections

echo (“<b>Collections in </b>” . $dbname . “<br/><hr/>”);


//Lets retrive the data in the collection “Page”

$collection=new MongoCollection($db, ‘page’);

//$Query =array();//(“username” => “Seesiva”);

$Query =array(“revision.contributor.username”=>”Seesiva”);

$cursor = $collection->find($Query);



echo (“<b>Titles Contribution for the Query: </b>” . array_shift($Query) . ” and total results found:” . strval($mycount) .”<br/><hr/>”);

//Retrieve the titles contributed by the User

foreach ($cursor as $doc) {







Step 8: Find the results

Cohort Analytics – Solving analytical problems on segmented data

Cohort Analytics

What does the term “Cohort” means?

“Cohort” means a group of people sharing common characteristics over a certain period of time.


* Cohort of people who have been diagnosed for “Diabetes” during the year 2013

* Cohort of students who has spent more than 5 days for Green cause during 2001-2004

* Cohort of users in Wikipedia who has stayed more than 5 years and contributed 100 edits every month

Applications or Uses of Cohort Analytics or Cohort Analysis:

* Segmented cohorts helps to refine and focus on the problem under question.

* Helps to identify the trend or pattern over a period of time.

* It provides or paves way to analyze a Customer with different time periods a cohorts and helps to analyze

Stages of Cohort Analytics:



In the next post we will look in detail about the cohort analysis with an example.