Showing posts with label data mining. Show all posts
Showing posts with label data mining. Show all posts

Tuesday, October 15, 2013

Reference for Introduction to Decision Trees

   Last weekend I've been at SFBay ACM Data Mining Camp and did an introduction session to Decision Trees, Stochastic Gradient Boosting and Random Forests. For people who are interested in further reading about this topic, I'm posting some links in this post.


Decision Trees

    Decision trees idea is to build a set of rules in hierarchical form, that will allow to predict the value of a target variable. Rules are usually in form of "if-then-else" statements and organized in the form of a binary tree.

Basic reading: 

Hardcore reading: 


Stochastic Gradient Boosting of Decision Trees

    This method of building predictive model is based on constructing a set of small regression decision trees, that are fitted (learned) sequentially, where each next iteration learns from error of previous iterations.

Basic reading:
Hardcore reading: 
    Original paper, which describes methodology: Jerome Friedman. Stochastic Gradient Boosting.


Random Forests

    The idea behind Random Forests, is that you are building strong classifiers on independently sampled data subsets, while using random selection of features to split each node. The generalization error for forests like this converges to a limit as the number of trees in the forest becomes large.

Basic reading:
Hardcore reading:
     Original paper, which describes methodology: Leo Breiman, Random Forests.


    As a conclusion, I would say that all three methods have their own advantages and disadvantages and it's worth learning how and when to use each on of them.

Wednesday, July 10, 2013

Introduction to Data Science books and courses

    I was asked about books and courses that will help to get started with learning Data Science (Data Mining, Machine Learning or Data Analysis).
   My main toolchain is Python, NumPy/SciPy/Pandas/Scikit-learn, Hadoop and MRJob. Based on this I put together a list of books that will good to start with:

Python

Learning Python. Mark Lutz.
Book to learn Python before jumping to data science. 

Python for Data Analysis. Wes McKinney.
http://www.amazon.com/books/dp/1449319793
Book from the author of pandas module. Great book to learn how to do descriptive stats with Python.

Programming Collective Intelligence. Toby Segaran.
Introduction to self written Machine learning algorithms with Python.

Machine Learning in Action. Peter Harrington.
k-Nearest neighbors, naive Bayes, SVM, decision trees with examples in Python

Hadoop

Definitive guide from one of the early contributors to Hadoop source code and person with wast experience working with it.

R & Stats

Data Analysis with Open Source Tools. Phillipp K. Janert.
Sometimes Python is just not enough and this book will help to start working with R.

Think stats. Allen B. Downey.
If you are coming from Computer Science major you better get this book about probability theory and stats.

Good read on Data Science

Predictive Analytics Power Predict. Eric Siegel.
Good read on Predictive Analytics philosophy and examples of real world tasks that people solved with it.

Courses

  • Introduction to Data Science - Good introduction to all main concepts that data scientist should know (SQL, NoSQL, Hadoop, R, Machine learning algorithms and visualization and etc).
  • Computing for Data Analysis - Course about learning R and solving real problems with it.
  • Machine Learning - Basics of Machine learning from Andrew Ng (Founder of Coursera and Director of AI Lab in Stanford).
  • Computational Investment - Course that will teach how building a trade-robot for stock exchange in Python using all the tools that Data Scientist uses (see as practical examples).

    This list of books and courses will be updated when I'll find something worth reading or watching on this topic. If somebody knows a good book that I should add to this list - please, let me know.

Friday, June 24, 2011

Data Mining 2011


Today, I got results from Data Mining Cup 2011. In results I occured on 15 place (from 35) for first task, and doesn't occured in second's task table at all (but I want to know why).
Still my results wasn't so bad for that simple algorithm (on this later) I made:
NumberNameScoreComment
1.TU_Dortmund_169835
.........
12.Uni_Siberian_Telecommunication_160550
13.TU_Wien_151704<-- strange jump in scores
.........
15.Uni_Kharkov_150627<-- me
.........
30.Uni_Chile_221018
.........
35.Inst_Telkom_21230
So, as you see, I occured on middle group, and as I think, in this group we all used pretty same alogrithm - modifications of nearest neighborhood. But top 12 people have another alogithm, and I'll try to figure out what it was.
Still now I am describing mine algorithm.
For learn step I made hash map, where key was item number and value - hash maps, which contains as keys - items that was viewed\ordered in the same session of initial key, and value - count of views\orders.
For example:
1000|1|0
1000|2|0
1000|3|0
1001|1|0
1001|2|0
And in result I'll have {'1': {'2': 2, '3': 1}, '2': {'1': 2, '3': 1}, '3': {'1': 1, '2': '1'}}.
And when I needed to get test results, I for each session, gather items that was already viewed\ordered, and merge values of this hash map. Than sort values and return top 3 of them, which wasn't already in session.
For example:
1003|1|0
1003|2|0
Merged hashmap will be: {'1': 2, '2':  2, '3': 2, '4': 1, '5': 3}. Next removing 1 and 2, because they already in current session: {'3': 2, '4': 1, '5': 3}. Sort by value and return keys: [5, 3, 4].
But if there aren't 3 values in resulting list, I will additionaly return top selling items. For example, after sort step list was: [3], than adding top sellers it will be: [3, 10, 15], where 10 and 15 - top 2 selling items, which were calculated on learn step.
Additionally, I used weight for views\add to cart\orders - 1, 5, 10 when building learning hashmap.

For task 2 I made the same, but it builds this hash map online and returns current best choices on each step.
But I'm very interested how top1-3 teams solved this tasks. If I'll find out and they'll allow - I'll post it here =)