Tuesday, August 13, 2013

Simple A/B test in Google Analytics

Google has it's A/B testing solution called "Content Experiments". Originally it was designed to test different page alternatives. In this case you had to build two different version of the whole page or website (link). This can be quite complicated. Google announced his new "Content Experiment API" which is more flexible but for me it's also a bit complicated for very simple tests. On the other side there is a really simple way to implement A/B tests on a website. Let's see how!

For the A/B testing we will use a couple of lines of JavaScript code. You can do any kind of split on your users but for now we will use a simple random split. The result of the split is stored in a long living cookie.


After having the A/B test cookie, the only thing you have to do, is changing your site behavior based on the cookie and passing the group value to the Google Analytics.
Very simple content experiment. ]]>
To have the same groups in the Google Analytics you only have to add this two lines to your original GA tracking code (more description in GA help): ]]>
To check the result in GA you only have to define custom filters in GA. Here are some screen shots how to do this:



Sunday, July 21, 2013

Vectorize Image with Python scikit-image

Short story: a friend of mine wanted to display an interactive dental chart on the web but most of the images he found was some hand-drawn image which wasn't fit into his site look-and-feel. So decided to vectorize one image, it shouldn't be a hard task ...
After some research I end up here:  http://scikit-image.org/docs/dev/auto_examples/ and I succeeded to get vectorized outlines in an hour. Lets go through it step-by-step:

0. This is an image with teeth I wanted to get in vectorized format, each tooth separately:


I have anaconda on my windows machine but if you have python with the general science tools (numpy, matplotlib, skimage, skipy) this code should work for you.

1. Loading the image from the file. With imread we get a 3D numpy array. In the 3rd dimension are the RGB values:


2. In the samples the algorithms where used on grayscale images, so firstr I had to convert the image to grayscale. This means I get a 2D array from the 3D one.

If it's needed the image can be croped simply with array slice (e.g.: cropedimg = gimg[330:480, 50:480]) and with matplotlib the image can be displayed any time just calling imshow(gimg).

3. Detecting the contours with skimage.

As result we get an array containing the vector representation of all found contour lines separately. Let's display the results:

4. For me the contour line was too detailed and rough so I wanted to have a more schematic result. With the tolerance parameter it's possible to set how detailed is the approximation. Finally we print an original and an approximated contour.



Wednesday, July 17, 2013

Personalization - Age of customer

Recently I found a Forrester report with a very similar finding to my previous post: Evolution of data management


"The age of the customer requires us to go beyond customer-centric thinking to customer-centric operations. In the age of the customer, three elements are essential to success: a customer-obsessed approach to defining the business and marketing strategy; an in-depth understanding of customers’ behaviors and needs; and a customer engagement strategy that is calibrated to those behaviors and needs. The onus is on marketing leaders to integrate intimate knowledge of customers into marketing activities that serve the needs of customers as they move through the process of picking their “first choice” vendor."

whole document.

Saturday, June 22, 2013

CIOs and big data

Successful big-data project is not so easy to accomplish. (300 IT personnel interviewed) .




Just found this infographic in a very similar topic as my previous post...

Wednesday, June 19, 2013

Evolution of data management




This info-graphics is made fully in HTML with D3.js. The code is not written as well to be sharable but it was a quite interesting experience to draw/build graphics with HTML and JavaScript code :).

Thursday, February 7, 2013

Basic technical indicators

A good description about basic indicators in FX technical analysis: common chart indicators

Thursday, October 25, 2012

General Regression Neural Network (GRNN)

Simple implementation of GRNN in Java. GRNN is a simple neural network which works similar to a KNN. There is a useful description about it: