Datamining, Privacy, and Ethics
[I'm trying to write shorter blog posts these days -- let's see how that goes]
There was a lot of chatter recently around about how Target (the shopping chain) has used data mining to identify pregnant shoppers in an effort to woo them as loyal customers. This is a prime example of things that are of direct interest to me: data mining, privacy, and the ethics surrounding the vast amount of knowledge we can compile about everything today, so I thought I'd share my perspective.
First off, the NYT article should not have been a surprise to anyone familiar with data. I've worked very closely with data mining teams on large retailers, insurance companies, and government agencies, and they uncover correlations all the time that lead to spooky predictability. The classic example of this is correlated sales of diapers and beer (from govexec.com):
A number of convenience store clerks, the story goes, noticed that men often bought beer at the same time they bought diapers. The store mined its receipts and proved the clerks' observations correct. So, the store began stocking diapers next to the beer coolers, and sales skyrocketed.
One common interpretation was that a new father was sent out in the night to get much needed diapers, which put him in the mood to buy a six-pack. Of course, that last part is purely subjective, but that's the story.
The article goes on to call this a "myth," but even if the specific case isn't verifiable, the decades-old example is on point for what it describes: Everyone™ is trying to make money by learning about predictable patterns, then exploiting those patterns to achieve their goals. This has been going on for thousands of years at a very human level in sales: vendors put up shops in high traffic areas, they're careful what they put in plain view to attract customers, they offer sales on one item and try to get you to buy more things once you're there, they give better prices to loyal customers. Think of those examples in a modern shopping mall, then think of them in an ancient city square. It's not hard to imagine examples in both places.
The difference is that we're getting to the point where we can see patterns that would not occur to even a very thorough store clerk. These insights require large amounts of data to verify and to pluck out the most important and exploitable correlations, but the results, as the NYT article indicates, can be pretty spooky.
Stores are now trying to gather more information and be more specific about where it comes from, specifically to learn these patterns. "Loyalty" card programs are an attempt to do just that... when you use a supermarket card you may save a few dollars (which is often incentive enough to use the card and to keep coming back), but the supermarket gets to associate your purchases with the purchases you've made every other time you visited the store. Stores can be very clever about this, too... if you and your four roommates all use the same loyalty card, but frequently pay with different credit cards, they can learn something from this... if you and your spouse use different loyalty cards but the same credit card number then, again, they learn something different.
Some people are even trying to identify what your privacy is worth to these companies.
Countless examples exist in retail. If your consumption doubles, then you may be shopping for two people; if your food choices get "healthier" you may be on a diet; if you buy cupcakes and birthday candles at the same time every year there may be a birthday... if you buy the big blue candles in the shape of numbers, they can probably figure out what age the birthday boy is. Facebook knows if you're in a relationship -- if you're single, expect to see advertisements for dating sites at some point... if not, expect to see advertisements for Ashley Madison [thanks for pointing that out, Barrett].
And the article is correct -- these data initiatives are powerful. It is something most people don't understand, and it has the potential to be very creepy. But there has been a lot of backlash about whether or not it is "ethical" or if it's an invasion of privacy, and I think that's much harder to discuss.
The main argument that these ARE invasions of privacy is that the information gathered could have negative consequences or could be used for more nefarious means. In the case of the Target article, some young woman was "outed" as being pregnant to people she was apparently trying to hide the fact from. If it was a doctor's office that had revealed the same information, very specific privacy laws could have been broken, but no such laws exist for shopping patterns, to my knowledge. If the issue was not health related, it still could have been embarrassing -- imagine if someone was shopping for an engagement ring, or was having an affair, or was planning to move or sell their house or send a relative to a retirement home. Is it safe for a company to know this about us?
Or what if you were planning on murdering someone? You obviously wouldn't want them to find out, right? :-)
And what is unsafe about it, exactly... is the only risk that they'll leak the information -- intentionally or not -- to someone we mind knowing? And not just the people we're trying to hide a secret (or a surprise) from, but are the people we "mind knowing" about us the entire general public? Conspiracy theories abound -- some more valid than others. Someone that can know when you're on vacation can know when to rob you. Someone that can identify who you are and where you are can profile, stalk, and do nefarious things to you, right?
Well... sort of.
It's fairly clear that younger crowds that have grown up with internet access and the ability to connect to all their friends instantly have a different attitude towards privacy. The backlash against the recent app Girls Around Me, which ties together information that users explicitly make available on Foursquare and Facebook and allows people to see who is nearby in a nice handy map with people's faces on it. Is this a tool for stalking, or is it a viable social tool? All the data is actively being shared, and the legitimate uses are pretty cool -- if you're out wanting to hang out with friends, this is cool technology. This is exactly what Google Glass does when two people are trying to meet for lunch -- it plucks their exact location from Latitude and puts them on a map.
I personally LIKE retailers to have a good idea of the things I want; advertisements tailored to me are better than the alternative. I already know too much about Kotex Tampons from mis-targeted TV advertising. It's a win-win for the advertiser and for, well, me. To me, the potential downsides, such as the criminal (like burglars, stalkers, and identity thieves), or financial (retailers ARE trying to get more money in the long run) are outweighed by the benefits -- lower prices, tailored content, and a more custom experience dealing with, well, everything.
I DON'T like the idea of my insurance company finding out how often I order pizza or what size pants I wear and then charging me more for health care because of it. But there's a whole other side to that story -- I'm sure tobacco smokers don't like being charged extra either, but that's actively happening and most people justify it.
The real problem is that people need to be made more aware of what their data can be used for. Young children need to be taught not only not to take candy from strangers, but also to not send risqué pictures of themselves to friends (a relatively new problem parents are facing). Consumers need to understand the risks of using loyalty cards and credit cards in terms of their shopping habits, and articles like the NYT Target article are one of the ways that education has to happen. However, I caution against a knee-jerk reaction that these things are bad. Yes, a poor girl's pregnancy was announced to the world in an unfortunate manner, but had things gone the way they were intended, that girl would have saved hundreds of dollars using coupons at Target, and Target would have earned a loyal, and lucrative, customer.
Ranting about Economics
Note: I ramble a lot in this post, and I'm not sure I agree with everything I said, but I'm starting back to work today so I don't have a lot of time to muck with it and I'm trying to get content out, so... you've been warned. If you want some interesting reading on the topic, here's a few links:
http://money.cnn.com/2011/08/12/news/international/short_selling_ban/
http://arstechnica.com/apple/guides/2011/08/does-this-metric-make-my-company-look-big.ars
http://money.cnn.com/2011/08/12/markets/high_frequency_trading/index.htm?eref=mrss_igoogle_business
http://efinance.org.cn/cn/aboutme/cmx3.pdf
....
I just entered West Virginia. This is because I'm on a trip and driving to the beach, having spent the night and dropped off a couple of dogs in Kentucky (with people [well… family], not just anywhere you know), we’re now safely ensconced in a Jeep Liberty, the four of us (two real people, two seventeen year olds) enjoying the extra space the dogs left us. Traveling this way means that you see a lot of countryside and inevitably have random conversations with family members you never see about politics and economics.
In particular, since the world economy has taken a bit of a dive lately, I figure it’s time for my personal rant on the topic. Let me start by saying that I’m not fond of economics, at least not formally. This stems mostly from an unfortunate economics teacher in college and my background in not-being-stupid. In one of our early classes, the professor drew an x-y axis on the chalkboard, placed a single data point, and after only a few moments of discussion drew a very attractive wavy line through it and called it a “supply-and-demand” curve like this:
Anyone that is not very upset by that chart should stop reading now, so that I do not offend you, and immediately go unfriend me on Facebook or put me in your “icky” circle on Google+ or something.
Here’s the math 101 short course for anyone that ignored my previous paragraph: you can’t draw a curve through only one point of data, because you don’t know which way the curve should go. It takes two points just to make a straight line, and at least three points to make a curve (and normally lots more unless you’re sure what shape the curve has). Is it a one-humped camel, or a two-humped camel? Or a sea-serpent? You get the idea. My relationship with formal economics went downhill from there.
Now that’s just the taste in my mouth – I admit it’s hugely important to study and understand how economies work. I am currently undergoing a microeconomic experiment by having just given the aforementioned 17 year olds $100 apiece to buy their own stuff for this trip so they won’t bother me and will hopefully learn the value of a dollar. Already they have passed up $7 slices of pizza to save money, so we’re learning something.
A Moment for the HTC EVO 3D
I've been a Sprint user for over 10 years, at least according to Amanda, who cheerfully explained to me why my cell phone bill never makes sense but that they appreciate my loyalty anyway as she sold me my new phone a couple of weeks ago.
My new phone is the HTC EVO 3D, but enough about that for now. First, it's important to talk about my PREVIOUS phone, which was the very underrated Samsung Moment.
The Moment was a very early generation Android phone which managed to hit just about all the design elements I wanted. Despite being a bit too slow (Angry Birds never played quite right) and missing out on simple things like multi-touch which Samsung apparently left out to get it to market quickly and inexpensively, it was one of my favorite phones. My Moment was a replacement for a Palm Treo which dutifully kept by my side for several years (forever in smartphone land).
The Moment was a wide slide-out keyboard styled phone. If anyone is reading this that designs phone keyboards, go pick this up and play with it -- it's the best. The keys are clearly separated and slightly raised so that touch-typing, such that is is on a teensy-weensy keyboard is actually possible. I wasn't quite able to bang out entire novellas without looking, but I could get pretty far into a decent text message with minimal mistakes while watching Netflix. The keyboard rocked.
Moreover, the Moment set aside the typical 4-button Android interface (Home, Menu, Back, Search) that seems prolific, instead opting for the three required buttons (Home, Menu, Back), and two buttons dedicated to phone operation (Pickup and Hangup, where the Hangup button also acted as a power button for the overall phone). Most importantly, though, the phone had a tiny touchpad that depressed as a select button. I haven't seen better cursor control on any smart phone, although the Palm and the Blackberry dedicated rollerballs and rockers are fairly close.
The HTC EVO 3D with which I now entertain myself boasts none of this coolness. The more-than-4-inch screen is gorgeous, responsive (the phone is wicked fast), and I've whittled down the on-screen keyboard options to a few that I like (I'm currently using SwiftKey X which has a curious habit of predicting words when nothing has been typed -- it currently assumes that I want to say "I am a beautiful person." if I don't give it any other starting letters). But it's not as cute or cuddly as the Samsung Moment.
But, and this is very important:
IT TAKES 3D PHOTOS!
Marbled Rye and Evolutionary Algorithms
Since no one has yet taken it upon themselves to write my unauthorized biography, it falls to me to make the following piece of information available to the public: I like to bake.
Breads and pies mostly -- I've got a couple of recipes posted here, including a pie crust that I'm pretty happy about, and a few things I've borrowed from other people. I've made a few rhubarbs lately that really turned out quite well.
One thing I recently attempted, was a Marbled Rye. This isn't a terribly difficult bread to make -- there are recipes everywhere. I was mostly pleased with it, though -- I didn't have any Caraway seeds, which add a lot of flavor, but the bread looked nice and better than a lot that I've made lately.

One thing I experimented with, though, was yeast.
Yeast is one of those things I don't really understand. This is because the most I remember about the biological classification taxonomy was that everything was an "Animal", "Vegetable", or "Mineral" -- I have no idea which one a yeast would be. This was a problem for biologists as well, so in 1990 they changed the top three domains to be "Archaea," "Bacteria," and "Eukaryota," which has helped me in no way whatsoever because not only do I still not know which one yeast would be, but I no longer know which one I'm supposed to be, and I much preferred back when I was an Animal and the world made sense.
Anyway, yeast are largely responsible for the existence of Bourbon, which automatically qualifies them as A Good Thing™ no matter what biologists call them. Baker's yeast, which makes us happy, is "Saccharomyces cerevisiae" (note the interesting comment in Wikipedia about Crohn's and Colitis on that page -- I never knew that), and lives everywhere, so it's pretty easy to get hold of. You can leave potato-starch filled water out for a while and yeast will just show up. All it does, really, is convert sugar into bubbles and alcohol. In breads, the bubbles (Carbon Dioxide) make the breads rise... in alcohols, the alcohol well, makes the alcohol alcoholic. Yeast is glorious.
Computing on the cheap with Amazon EC2
We here at the happy technologist tend to host our own servers, because we like it, and because we can. (We also speak in the third person when there's just one of us, but there's no accounting for some people). Nothing fancy, mind you... for now, a handful of websites are running on an Ubuntu virtual machine through VirtualBox on a Windows 7 (or maybe Vista, I forget) box that otherwise serves as a Media Center. It's actually simpler than it sounds.
Lately, though, what with the Heritage Health Prize and a lot of hours spent learning and playing with data mining techniques, the poor little server has been called upon to do much more intensive work. It's routinely running simulations and calculations all night long and it's really not built for that. The fan has started humming heroically (i.e. loudly), which isn't always best for a media center.
Noone wants their media center to hate them, or to catch fire.
Enter Amazon EC2. That stands for Elastic Compute Cloud. See how clever that is -- what they did with that 2 there? Rather than go "ECC", they just counted the C twice and made it like a math or a chemistry equation. These Amazon guys are some serious funny. I'm actually very impressed with the setup they have. There's a wealth of options for configuring the virtual servers -- public AMIs (preconfigured images) are available for most major software vendor platforms, from the expected Oracle, Microsoft, and Linux offerings to MicroStrategy, R, Elastic Bamboo, Citrix, and even BitCoin configured software. Public data sets are available should you need them, advanced storage, database, failover, clustering, networking, identity management, queuing, notification, and probably a million other things at pennies-per-hour prices.
At the moment, I'm running a simulation on a 20-CPU 1.6 Terabyte beast of a machine for $0.228 per hour. This is the sort of thing that infuses me with glee. It's easily outperforming my media center by 30:1.
Unhappy Bits about Bitcoins
I wandered across bitcoin not too long ago, during some random web crawling, and downloaded it in May. I installed it, ran it, realized I was behind a firewall, killed it, uninstalled it and forgot about it for a couple of weeks until this Wired article came out and sent the whole world a'twitter about bitcoin again.
The Wired article, in short, talks about an underground website that sells illicit drugs and whose sole allowable currency is the Bitcoin. The website itself is shrouded in anonymity in the TOR network which itself is an excellent little piece of technology which I'm planning on running out of space to describe here just now, but you should look into it.
The Bitcoin spiked in popularity. You can buy and sell Bitcoins in open marketplaces such as Mt Gox (whatever that means) or Lillion Transfer if you're using some more international currencies, or you can use them directly on sites that take them, such as this Alpaca sock store. Prices quickly went from a few dollars to around $30, although they've now backed off a bit to around $20/BTC (Bitcoin).
Ok, so where are we? We can buy cocaine and alpaca socks with Bitcoins. Great. But what ARE they, again? How can you get some, and should you care?
Mosaics and More Algorithm Love

My mom (whose website I should update) recently celebrated her birthday. My mom is an avid shutterbug, and abuses the digital camera we got for her a handful of Christmases ago to the tune of 10,000 photos a year, give or take. Our basement is piled with boxes of images just begging to be scanned, cataloged, sorted, and all that from back when mom was a film user (you all remember film, right?). I daydream of software that will actually be useful to that endeavor -- to say nothing of how fun it would be to digitize the piles of super-8mm movie film that goes along with it -- but so far we haven't made much of a dent.
In the mean time, though, I have a hard drive which contains about 150,000 photos from my mom's library... basically a full off-site backup in case horror happens to her computer. (ObNote: This is good practice, boys-and-girls, you should all go about giving hard drives away, with complete backups of your stuff in case of a disaster... you'll thank me when the revolution comes). Anyway, I was looking around for a way to leverage this wealth of digital media for a birthday present and decided to go with a photomosaic.
Musings from a few weeks of data mining
Ok, I'm still no expert data miner by a large margin, but I've learned a LOT in just a few weeks of playing with the Heritage Health Prize data. The folks on the Kaggle/HHP Chat Board are pretty helpful, and the internet is full of useful information. I've taken to using Excel and MYSQL far more than any mining-specific tools. I have been interested in R and RapidMiner, and I've been able to set up a few basic models with those tools. One thing I've been very happy with is the wealth of online tutorials available for just about everything. My resident 16 year old has been using them for a while to pick up piano and guitar songs, but I haven't had much use until now; I'm pleased to report that the quality of these online free video or web tutorials is pretty high. I have a list started as a del.icio.us tag set if you want to see what I've been watching.
I've made 9 submissions (the first two or three of which I don't count -- let's call those 'test' submissions). The 9th actually had a worse score than the 8th. Now that interests me. On my tests, which include several different sampling and "cross validation" methods on the two years of available data, my score on each submission improved from the last... not much in this last case, but enough for me to feel reasonable in submitting the algorithm. Why, then, did my result against the real data using the same algorithm go backwards? One possibility is that I've been overfitting the data. Basically, my algorithm makes assumptions that are either unnecessary or are only applicable to the sample data, and don't hold true for the final data. At the tolerances we're dealing with, it's still possible that this is just a random selection bias issue, but it's still interesting, and a common and very important problem in statistical data mining: how can you know when you've overfit? When do you know that you're "trying too hard" as it is.
Dayton Technology Landscape Conference
Technology First is a local IT Trade Group, and their second annual "Technology Landscape Conference" was yesterday, so I dutifully (duty = I'm dating their intern) attended.
Ok, so there was some more duty... one of the companies presenting was ExpeData, a Dayton, Ohio (which is "local" for us folk) company who has a digital writing capture technology. We've been working with them for a few months to find some suitable applications and to discuss some security issues and requirements. It's a fairly interesting technology, although I have some trouble finding its killer-app.
Another interesting company whose presentation I attended was Persistent Surveillance Systems -- these guys have a 190+ MegaPixel camera array that they fly over the Cincinnati area (among others), taking pictures about once per second. When they hear about a crime, typically a murder, after the fact, they can go back and assign analysts to review the captured images to track people in the vicinity. Their software allows analysts to assign colored tracks and markers to people, vehicles, and anything else of interest -- they initially track suspects, then go back and track anyone they interacted with, anyone nearby (possible witnesses/accomplices), and whatnot. The large pixel view of the city and long video times allow them to watch people drive all the way to their destination -- a home, hideout, friends' house, or whatever -- where they can then work with police to get a warrant and follow up as appropriate. Their metadata is even good enough that they can apparently cross reference locations to find that, for example, the getaway driver from murder A may have lived next door to the suspect from murder B, which may help detectives tie together previously unrelated crimes.
