Skip main navigation

How do you classify documents?

Ian Witten introduces this week's second Big Question

Document classification is a popular and important application of data mining.

But how can it be done? Weka allows string attributes, and it’s simple to load an entire document into a single “string” attribute, but what then? We need to be able to get inside the document, to somehow look at its content, in order to stand a chance of classifying it.

It’s easy once you know how. That’s what you’re about to find out.

You’ll also learn about a new classifier, Multinomial Naïve Bayes, which is particularly appropriate for text classification. And you’ll learn ways of evaluating two-class classification that are more nuanced than the “percent correct” we have been using so far.

Aside: I learned about the problems of evaluating correctness years ago, when we were trying to apply machine learning to detect when a cow is on heat from various behavioral attributes. (Really! This is an important economic issue for artificial insemination. Believe it or not, semen is expensive.) Cows have similar menstrual cycles to women, and remain in estrus for about a day. If you always predict “This cow is not in estrus today”, you’ll be right about 96% of the time (27/28). That’s an impressive correctness figure. But it’s not necessarily what you want.

At the end of this week you’ll be able to use Weka to classify documents. And you’ll be able to use “threshold curves” to show different tradeoffs between error types (e.g. predicting “in estrus” for a cow that is not in estrus is a different type of error than predicting “not in estrus” for a cow that is in estrus)*.

This article is from the free online

More Data Mining with Weka

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education