Showing posts with label R. Show all posts
Showing posts with label R. Show all posts

Tuesday, August 16, 2016

Product list optimization project, part 1.1. Google Analytics tuning: Custom dimensions

First of all, there is a common approach to manage Google Analytics implementation - through Google Tag Manager. This method has many advantages, but discussion of those is beyond the scope of this series of posts. From now on I assume this approach by default.

There is a great article of Simo Ahava “Improve Data Collection With Four Custom Dimensions”. It’s about 4 parameters which aren’t among dimensions and metrics of Google Analytics API by default, but are crucial for many web-analytics tasks. I didn’t use User ID in this project, but Client ID, Session ID and Hit timestamp were very helpful.

For those of you who decided to implement these custom dimensions too, I want to warn you about the subtle mistake in the Hit timestamp setting. I’ve written detailed comment about this under Simo’s article.

So in brief, when you configure Custom JavaScript Variable, you can’t treat milliseconds as other parts of the time (Hour, Minute, Seconds), because it’s a three-digit variable. Otherwise, “0.089” becomes “0.89” and exceeds “0.123”, which leads to awkward results in data when some page events precede their predecessors.

To fix this, you should add another function and apply it to milliseconds:

var pad00 = function(num) {
var norm = Math.abs(Math.floor(num));
return (norm < 10 ? '00' : (norm < 100 ? '0' : '')) + norm;
};

Wednesday, August 10, 2016

Products list optimization project, intro

The next series of blog posts is dedicated to the UX research project I’ve accomplished recently. The described approach could be useful for e-commerce websites and online stores, especially those with large product catalog.

Motivation and Main idea.
Products in the catalog subcategories get unequal shares of user attention. Those in the top of the list are seen by almost all users. Bottom of the list gets multiple times less attention (twice as a minimum). Most users don’t scroll all the list throughout.
But as statistics tells us, often the products from the top of the list don’t attract users’ interest. They don’t click on these products, they don’t put them to the shopping cart. At the same time, bottom list products get much more interest.
So the main idea is to analyze ratio of each product’s visibility (attention) and users interest, and put most popular items to the top of the list in order to sell more.

Summary of this series.
First, we make some tunings in our Google Analytics data collection process. We should track the page scroll to measure each product’s visibility. Also we need to gather information about clicks on the links to the product’s page and ‘Buy’ buttons for each product.
Second, we connect to the Google Analytics API from statistical environment (Rstudio in our case), retrieve necessary information, make some exploratory data analysis and get the final report. This report gives us directions as to what permutations should be done in subcategories of our product catalog.

So next time, we will start off with GA tuning.

Monday, July 6, 2015

Kaggle Walmart competition

Just submitted my code on GitHub, which gave me the first Kaggle badge (top 25%).
https://github.com/Oleg-Davydov/kaggle_walmart_competition
I used Gradient Boosting with R package caret. But before that, there was a lot of preprocessing.
This was my second Kaggle competition. I finished 86th out of 485 participants, 1% of score difference with the winner.
Probably not bad for the start :)

Tuesday, June 9, 2015

Wine quality assessment app

Developing Data Products course, ninth and last in Coursera's Data Science Specialization, finished. As a course project, we had to build web-application with elements of machine learning. And then make a pitch presentation for that app. We were expected to use Shiny package and Shinyapps.io platform to publish our projects on the web.

I found an interesting dataset of Portugal wines' chemical characteristics and assessed quality in UCI repository. It gave me an idea that one can predict wine quality after chemical analysis.
Random Forest was chosen as a modelling tool. I hosted the model right on my github account:
https://github.com/Oleg-Davydov/winequality

And there you are! :)
https://laborant.shinyapps.io/winequality

Pitch presentation was restricted by five pages including the cover. I added a bit of humor in it :) Use right and left arrows on your keyboard to turn pages.
http://oleg-davydov.github.io/winequality/Rpresenter.html

Wednesday, April 8, 2015

Workout in a right way

Do you do physical exercises? Do you do it right? :)
Our course project in Practical Machine Learning course https://www.coursera.org/course/predmachlearn was about this topic. Several people put on an accelerometers and performed some exercises the right and the wrong way (consciously). So our task was to build the model to predict whether a person does barbell lifts correctly or incorrectly.
I used Random Forest and Gradient Boosting algorithms. RF has won in a Cross-Validation. Here is my report: http://oleg-davydov.github.io/PML_course_project/course_project.html

Traditionally, many thanks to our instructor Jeff Leek, professor of Johns Hopkins University!

Saturday, March 7, 2015

Statistical Inference and Regression Models

That was different! Two new courses in Data Science Specialization on Coursera. Two courses of almost pure mathemathics. Pure pleasure! :) Many thanks to my instructor Brian Caffo, professor of Johns Hopkins University!
Even though these concepts are mostly familiar to me thanks to my alma mater, Moscow State University, it's very useful to see them again in combination with R language.

Monday, February 2, 2015

A project for Reproducible Research

Just finished a big report for the course project. This was a part of Reproducible Research course on Coursera. https://www.coursera.org/course/repdata
The subject of the analysis was the most severe weather events and their consequences with respect to population health and economics.
http://rpubs.com/Oleg_Davydov/56961
A couple of interesting details.
I used generalized Levenshtein distance to handle raw data. Event coding in formal instruction and in real database weren't identical.
One of the tasks was to draw at least one plot. So I've made two US maps of weather events impact on population health and economics.

Thursday, December 18, 2014

R programming

Today I got a certificate of completion of the R programming course, the second course in Coursera Data Science Specialization. https://www.coursera.org/course/rprog
And again, with Distinction, 100% grade! :) Many thanks to the great instructor Roger Peng, professor from Johns Hopkins University!

Wednesday, September 24, 2014

Coursera Data Science Specialization

Just enrolled in my first online course. It's 'The Data Scientist’s Toolbox', the first part of Coursera's Data Science Specialization. https://www.coursera.org/course/datascitoolbox
Hope to refresh my math skills a little bit and get a closer look at R programming language.