Showing posts with label ThinkOR - Think Operations Research. Show all posts
Showing posts with label ThinkOR - Think Operations Research. Show all posts

Friday, October 25, 2013

How to Learn Python and R, the Data Science Programming Languages, from Beginner to Intermediate and Advanced

The Data Science programming / analytics languages to know are, R and Python. If you're in Operations Research or another analytics field that somewhat fits under the "Data Science" hat, you: a) already know them really well, b) want to brush up on them, or c) you probably should learn them now. Here I compile my thinking on how to learn R and Python from Beginner to the Intermediate and Advanced levels, based on having tried some of these course materials.

Beginner (doing basic analysis)

R:

Computing for Data Analysis on Coursera and Youtube (weeks 1, 2, 3, 4), by Roger Peng from Johns Hopkins University

  • Summary: It covers the basics of conditioning and loop structures, R's syntax, debugging, Object Oriented Programming, performing basic tasks with R, such as importing data, basic statistical analysis, plotting and regular expressions. See syllabus for more.
  • Time commitment: 11~36 hours total, including: 
    • non-programmers: 4 weeks X [3 hours/week on video + 2~6 hours/week on exercises]
    • programmers: [3 hours of notes reading + 8~16 hours] on exercises
  • Advice for: 
    • non-programmers: Listen to all lectures (videos), make sure you understand all details, and do all the exercises to hone your skills. Programming is all about practicing. Doing the exercises are important. See below for "Advanced".
    • programmers: Don't bother with the videos, go straight to the lecture notes (link). Read the notes - much faster than the videos. if you don't understand anything, look up the video and watch, or google the topic. Then do all the exercises. You don't need me to tell you that practice is king (um, and cash too).

The swirl package within R, by the Biostatistics team at Johns Hopkins University
  • Summary: It aims to teach R and Statistics within the R environment itself, through a package called swirl. See the announcement here for more detailed info.
  • I haven't tried this, so I'm not sure how much time it takes or how good it is. However, I think it sounds pretty good, and deserves a mention. I was never a fan of reading books to learn a programming language. Show me the code, or in this case, let me write the code, and get involved, is much more, well, involving.

Python:

Google's Python course (link)
  • Summary: It's straight to the meat, no non-sense stuff, and covers all the important things. Suits my style. Enough said, so see the course page on the syllabus. 
  • Time commitment: 8-10 hours
    • including reading notes and doing exercises
  • Note, this is for experienced programmers. There are videos too, but don't bother. The notes on the course page are the same, and it always takes less time to read than watch.

Intermediate (building analytical models)

R:

Data Analysis with R on Coursera and Youtube (plus class notes), by Jeff Leek from Johns Hopkins University
  • Summary: It covers the full modelling cycle, from getting data, to structuring the analysis pipeline, exploring with graphs and statistical analysis, modelling (clustering, regression and trees), and model checking with simulation. It also talks about important statistical watch-outs like p-values, confidence intervals, multiple testing and bootstrapping. More syllabus here.
  • Time commitment: 32~56 hours
    • including 8 weeks X [2~3 hours/week videos + 2~4 hours/week exercises]


Forecasting using R (link), by Rob Hyndman from Monash University in Australia and Revolution Analytics (the enterprise R solution)
  • Summary: topics include "seasonality and trends, exponential smoothing, ARIMA modelling, dynamic regression and state space models, as well as forecast accuracy methods and forecast evaluation techniques such as cross-validation. Some recent developments in each of these areas will be explored" (quoted from course site). Read more there.
  • Note: I haven't done this (just started), so I'm not sure about its time requirement or quality. I'm also not sure if they are planning to make available the lectures. Time will tell on these questions.

Python / Octave:

Machine Learning on Coursera, by Andrew Ng from Stanford University --> My Favourite!
  • Summary: The course actually teaches in the Octave language, but it all can be done in Python. I suppose you can do it twice, first in Octave, and then in Python, if you've got the time. It certainly would solidify your understanding of the material, and Andrew Ng is sure that Octave is rather important in Machine Learning. It assumes some prior knowledge of linear algebra and probability, and refreshes you on some basics. "Topics include: (i) Supervised learning (parametric/non-parametric algorithms, support vector machines, kernels, neural networks). (ii) Unsupervised learning (clustering, dimensionality reduction, recommender systems, deep learning). (iii) Best practices in machine learning (bias/variance theory; innovation process in machine learning and AI)." (quoted from the course website)
  • Time commitment: 50~90 hours
    • including 10 weeks X [2~3 hours/week videos + 3~6 hours/week exercises]
  • Note: this course covers a subset of the statistical and modelling principles from the Data Analysis with R course above, but the overall level is more advanced. I enjoyed this course the most.

Advanced (you follow the drift from above)

Advanced = Experienced.
This is true for programming, analytics, and learning any foreign languages.

"Just do it", is how you get experienced.

There is no course on this stuff (i.e. being advanced), not without a PhD _plus_ years of field work.

My best suggestion is use your curiosity. Find a problem. Dig into it.

Plus, work with other people that are really good.



Happy learning!


Saturday, April 6, 2013

Timberland customer care & operations - I approve!

Buying a brand is buying quality - that's especially true for outdoor equipment.

With this belief, I purchased a pair of Timberland hiking boots that said "Waterproof" on a piece of official-looking metal attached to them. I then ended up with wet feet during an 8-day trek in Patagonia where it often rains - that sucked.

With my toes literally swimming in water within the boots, after a soppy wet day of a 19km hike, I was not a happy camper. However, my perception of Timberland took an 180 degree turn for the better.

Having bought the boots in southern Chile in a Bata store, having used them extensively and been disappointed and upset by them, I ran into a Timberland brand store 2,500km away from where I bought them, still in Chile. I went and complained about my disappointment in these supposedly "waterproof" boots, and I was offered the chance to exchange them for a brand new pair that is indeed waterproof, paying only the small price difference between the two pairs.

This is operationally remarkable:

Different stores (Bata vs Timberland)
I bought them in Bata, which is a popular international brand that happens to carry the Timberland boots. However, I was able to exchange them in a Timberland own brand store. Given the receipts I got from the Timberland store says "Bata" on it, I suspect the two are operated by the same company. However, as a western audience, can you imagine buying something in Gap and then returning in Banana Republic (same mother company)?

Different cities and provinces
I don't know how it's like in the US, but in Canada, returns and exchanges wouldn't be possible cross provincial borders. Yet, in this case, it was not a problem.


After the 14-day exchange period without the paper receipt
It was at least 3 weeks after the original purchase date, while the receipt stated a 14-day exchange period. I also didn't keep the paper receipt (trying to be light while travelling), but I had a photo of it on my phone. This I was able to email to them to enable the processing. Again, can you imagine this to happen in a western country? 


"Waterproof"  "Gore-Tex"
Finally, for everyone's learning, apparently, if it only says "waterproof", it's not waterproof. Only if it says "Gore-Tex", then it's actually waterprof.


I went into the Timberland store only to vent my frustration. I was positively flabbergasted when they offered to exchange for a new pair. Not only is the customer care commendable, but operationally that this could happen is something I would never have expected. They basically went against all the rules I know that would make this infeasible in western countries. Yet, the teens that worked at the Timberland store were willing enough to find ways to help me, a foreigner with broken Spanish, so I would have this outstanding experience and be happy with the decently expensive pair of hiking boots. How they keep the books straight on this transaction is beyond me, 'cause surely they are running Bata and Timberland as two separate business entities. 

The result: Timberland now has a new loyal customer. This is an outstanding example of great customer care made possible by some well-integrated and smooth operations.

Sunday, July 31, 2011

An Alternative Way to Fly (as long as expectations are managed)

The purpose of this post is to share the discovery of an alternative way of operating an airline (flight schedule and route wise).



No matter how airlines degrade their service standards these days in the West, I think it's fair to say that most of us still believe that most airlines *intend* to:
  • Take off on-time
  • Land on-time
  • Fly us from A to B as the ticket says, without surprise stops
  • (Oh, and have toilets, of course)

On a recent trip to Ethiopia, we have been shown a rather different way of operating an airline. It contradicts with all of the above, but it works. We took 4 internal flights.

Here is how we experienced them first hand:
  • 1 left on time as per the ticket, and even got us there early (bonus!), because...
  • None of the 4 flights flew the original path it said it would: stopovers were skipped to go direct instead, or the direct flights got stopovers added onto it last minute
  • None of them arrived late, because...
  • Some of them took off earlier than stated
  • Additionally, the air stewardesses were lovely, and they gave passengers snacks and drinks (*gasp* what novelty!)
  • To their credit, they did try to inform passengers of the changes a couple of days ahead of the flight (in our case by email, which we only read after we got back to London).
  • They also tell passengers to double check the flight times a couple of days before, to be aware of any late changes.
(For your curiosity: the international flights from London to Addis Ababa was quite standard. The only oddity was that they weighed everyone's carry-on luggage at the gate, because it's apparently a popular flight to take lots of stuff with you!)

IMHO, an airline would play this game, because: (we suspect - unconfirmed)
  • It wants to minimise costs - mainly fuel in this case.
  • It has 1-2 planes that fly in circles to cover off a handful of popular destinations.
  • As the airline gets more and more requests for seats through the form of purchased tickets, it is faced with an optimisation problem to fly all its customers to their expressed destinations with minimum cost. The best way to do this is probably through re-shuffling the schedule. For instance, if a plane is hopping from A to B to C in sequence, where B is closer to A than C is, and if we discover 2 days before the flight that the plane is filled with 2/3 passengers going to C, and 1/3 going to B, then flying A->C->B is cheaper than A->B->C. What if there are customers wishing to go from B to C? We hear that the airline is known for cancelling flights as well. Luckily, we didn't experience this.
This way of operating an airline is possible, because:
  • It is a monopoly.
  • The number of flights are few, so it's easy to manage change.
  • Customers expect it and adjust flying behaviour accordingly (i.e. always check the flight times before the day of flight, and always leave wiggle room before and after the flight).
  • For foreigners who are used to the typical western airline service (i.e. expect it to take-off and land on-time and fly the route it says it would), the price justifies it and shuts people up from complaining, and instead people will have a laugh (or write a blog post!) about it.
  • It doesn't call itself "Precision Airline" (the Tanzanian airline), and can afford to deviate a little. 8-)
P.S. If you are planning to visit Ethiopia, and intend to fly within the country, you may want to consider buying the tickets within the country rather than online. It is significantly cheaper due to price control. This is true as of spring 2011, so double check this before you travel.

Monday, February 7, 2011

I heart smartphones and podcast favourites

I heart smartphones. It is the symbol of the new world, where the world is at your finger tips, and, in your pocket! There is so much information out there, digesting it is a big quest. I'd love to have the time to sit down and browse the net for a couple hours every day to catch up on all the news and events, but now I can do all this while on the move.



I am an owner of an HTC Hero on Android. It is the only digital device I carry in my hand bag (other than my obligatory work phone). Living in a busy city like London means I spend a fair amount of time in transit. If you are a Google fan like me, then Google Reader and Google Listen would be your good friends. My favourite activity during transit when I'm not walking about, is to catch up on the news and my favourite blogs through the RSS reader. My favourite activity during transit when I am walking about, is to plug into one of the following podcasts, which keeps me informed and entertained. If this is not optimising your time, then I don't know what would. I guess the next step is to jog to work while listening to podcasts: information downloading and calorie offloading all at once!

  • LSE lecture and events: London School of Economist half hour to hour long lectures or guest speakers plus Q&A session (frequent publishing of events)

  • The Economist: I like the magazine, but there is so much content to digest. The podcasts do a great job summarising the highlights (weekly publishing or more frequent ones available too)

  • NPR News: short bursts of news that keeps me informed of the North American highlights (hourly publishing)

  • Science of Better: Operations Research podcasts/interviews by INFORMS (monthly publishing)

  • More or Less: BBC radio programme making sense or debunking the numbers behind the news

  • Freakonomics: spin off by the authors of the ever so popular Freakonomics book/movie/blog/etc.

What are some of your favourite podcasts?


Aside from being my RSS reader and podcast player, my smartphone is also my:
- phone (first and foremost)
- email
- calendar
- access to the internet
- Skype to call anyone around the world
- instant messaging to keep in touch with friends
- handy document storage
- camera / video cam
- GPS and compass
- maps (offline maps too)
- ebook reader
- notebook (takes my hand scribbling too)
- news reader
- scanner
- games when I'm bored waiting in a queue somewhere
- MP3 player
- all the other things that come with a phone (alarm clock, calculator, voice recorder, etc.)
- and thousands of other applications available for download (often for free) that keep my life organised and what not

Friday, February 12, 2010

Happy Birthday to ThinkOR.ORG - 2 years old

Happy Birthday to ThinkOR!

We are 2 years old. :)

Feb 10, 2008 was when I first registered and started the blog to promote Operations Research (also because I was looking for any reason not to study for exams). As a newcomer to OR, it bothered me that people did not know what OR was/is. It still bothers me, but a bit less now, knowing that I'm doing something (albeit very little), to try to change that, an article at a time.

I've since got a few more contributors to ThinkOR.ORG (thank you guys!), have met a few fellow OR bloggers (hi! *wave*), and have a small group of regular readers. Every month, hundreds of people all around the world (130 countries to be exact) visit the blog. How can you not love technology?

In return, I am always on the look out for interesting topics to write about to share with you all. Now I'm going to pack my backpack in the most optimal way with the objective of minimising space and weight for my trip to India tonight. I have a hunch that I'm going to have a few interesting posts coming up in the next little while. ;)

Happy blogging!

Saturday, January 2, 2010

Psychotherapy and Operational Research / Change Management

Happy New Year to the ThinkOR readers and the Operational Research community.

What better way to celebrate the new year than learning something new!

1. "Although there are many details about our patients that we cannot know, nonetheless, our task is to delimit a system of observation in which we can trace the essential causal chains, and find accessible points, or handles, where interventions can be made."
2. "...It is perhaps clear... that the choice of a system is not only dependent upon the nature of reality, but also upon the means we have to investigate it and the purpose of the inquiry. The larger the system we choose, the safer we can be in assuming that it will include the relevant causal relationships. However, such a system may not be manageable and therefore of no help at all."

Upon first glance, these would look like quotes from an Operational Research book. However, they are in fact quotes from a book titled Integrated Psychotherapy, published in 1979 by the wonderful family friends, Doctors Ferdinand Knobloch and Jirina Knobloch, who are renowned Psychiatry Professors specialising in psychotherapy. I want to share with you the similarity of a psychotherapist's task and an OR practitioner's.

Never would I have thought that there'd be anything in common between Operational Research and Psychotherapy, a branch of Psychiatry, treating patients with mental health problems through communication and contact, without medication. Wikipedia's definition of Integrated Psychotherapy is:

Integrative psychotherapy may involve the fusion of different schools of psychotherapy. The word 'integrative' in Integrative psychotherapy may also refer to integrating the personality and making it cohesive, and to the bringing together of the "affective, cognitive, behavioral, and physiological systems within a person".

The first quote from the Integrated Psychotherapy about a psychotherapist's task made me think of my work immediately. I am currently a project manager at a children's hospital in London working on process improvement and transformation projects. When we go about solving systematic problems within a process to improve it, it is impossible that we understand all details of such a process. Our goal is, as exactly Dr Knobloch's describe, to find out enough information to diagnose the problem, understand why the problem exists ("trace the essential causal chains"); then we need to identify the levers to improve upon it, to successfully apply any change management ("find accessible points, or handles, where interventions can be made").

The second quote about the choice of a system rings rather true for any simulation projects. The perfect system is the real world itself, but it would be rather impossible to simulate it.

Thursday, January 22, 2009

Operational Researchers and Industrial Engineers - Top 10 Happiest Professionals

As an Operational Research professional, the kind of work we do is pretty exhilarating. Don't you agree?

Recently at work (a major health care authority), my team did some analysis of the emergency department visits trend. We presented our findings and communicated our recommendations to the senior management based on thorough quantitative analysis. I left the boardroom thinking "geeze, who knows when the recommendations will be taken seriously, but if only they would". Then a week later (a week only, can you imagine?!), to my surprise, we hear about the ED changing the physician coverage based on our suggestions and analysis. To take it one step further, they have voluntarily asked for continuous measurement and report to see how this has impacted the ED operations. It made my day! However, I should emphasize that we are lucky to be working with progressive clinical staff who are open to quickly try new suggestions. Cooperative clients make a very happy OR consultant.

It feels good to be useful. I'm sure this is a feeling shared by many other OR professionals. Naturally, we enjoy our line of work, and we are one (or two) of America's top 10 happiest professionals.

At number 7:
Science technicians
Job Description: Use principles and theories of science and mathematics to solve problems in research and development, and to help invent and improve products and processes.

Very happy: 51.0%
Median salary (research scientists): $72,435



At number 9:
Industrial engineers
Job Description: Design, develop, test, and evaluate integrated systems for managing industrial production processes.

Very happy: 48.4%
Median salary: $61,729
So we have some frustrating moments (a lot of them, actually), but when it works according to design, it puts a big smile on my face. :)

Sunday, February 10, 2008

Welcome to ThinkOR - The Operations Research Blog

ThinkOR - Think Operations Research is a blog dedicated to the OR field.

ThinkOR welcomes all operations research professionals, academias, and any interested parties to come together and discuss and post your views, opinions, and ideas on operations research.

It is the gathering of the minds to talk about the methods of OR, applications, new ideas, etc. It serves as an exchange corner for the OR professionals, and an information source for the general public.

At this moment in time, there is very little information on OR for the general public to even know about what OR is. We hope that with this little space on the web, ThinkOR.org will be able to provide this type of information from a very personal view through the participation of all interested parties.