{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Homework 4 -- Name(s) here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Due Wednesday, November 30 by midnight**. You may submit this assignment in groups of 2. Be sure to put your names above." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this homework, we approach the problem of identifying a small subset of a dataset using unsupervised and supervised methods. The dataset we'll use is a set of newsgroup postings from the early days of the internet.\n", "\n", "In a real world application, we often don’t have labels, and clustering and outlier detection are usually applied in settings that don’t have labels. For the clustering part of this homework, you should work without the ground truth labels as much as possible. Often inspecting and visualizing the data is the only way to understand the result of clustering.\n", "\n", "However, since we do have ground-truth we could do a post-hoc analysis and determine how well we actually did. You might explore that after you've done the clustering." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "rec.sport.hockey 600\n", "soc.religion.christian 599\n", "rec.motorcycles 598\n", "rec.sport.baseball 597\n", "sci.crypt 595\n", "rec.autos 594\n", "sci.med 594\n", "sci.space 593\n", "comp.windows.x 593\n", "sci.electronics 591\n", "comp.os.ms-windows.misc 591\n", "comp.sys.ibm.pc.hardware 590\n", "misc.forsale 585\n", "comp.graphics 584\n", "comp.sys.mac.hardware 578\n", "talk.politics.mideast 564\n", "talk.politics.guns 546\n", "alt.atheism 480\n", "talk.politics.misc 465\n", "talk.religion.misc 377\n", "Name: Category Name, dtype: int64\n", "I was wondering if anyone out there could enlighten me on this car I saw\n", "the other day. It was a 2-door sports car, looked to be from the late 60s/\n", "early 70s. It was called a Bricklin. The doors were really small. In addition,\n", "the front bumper was separate from the rest of the body. This is \n", "all I know. If anyone can tellme a model name, engine specs, years\n", "of production, where this car is made, history, or whatever info you\n", "have on this funky looking car, please e-mail.\n" ] }, { "data": { "text/html": [ "
\n", " | Text | \n", "Category Label | \n", "Category Name | \n", "
---|---|---|---|
0 | \n", "I was wondering if anyone out there could enli... | \n", "7 | \n", "rec.autos | \n", "
1 | \n", "A fair number of brave souls who upgraded thei... | \n", "4 | \n", "comp.sys.mac.hardware | \n", "
2 | \n", "well folks, my mac plus finally gave up the gh... | \n", "4 | \n", "comp.sys.mac.hardware | \n", "
3 | \n", "\\nDo you have Weitek's address/phone number? ... | \n", "1 | \n", "comp.graphics | \n", "
4 | \n", "From article <C5owCB.n3p@world.std.com>, by to... | \n", "14 | \n", "sci.space | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "
11309 | \n", "DN> From: nyeda@cnsvax.uwec.edu (David Nye)\\nD... | \n", "13 | \n", "sci.med | \n", "
11310 | \n", "I have a (very old) Mac 512k and a Mac Plus, b... | \n", "4 | \n", "comp.sys.mac.hardware | \n", "
11311 | \n", "I just installed a DX2-66 CPU in a clone mothe... | \n", "3 | \n", "comp.sys.ibm.pc.hardware | \n", "
11312 | \n", "\\nWouldn't this require a hyper-sphere. In 3-... | \n", "1 | \n", "comp.graphics | \n", "
11313 | \n", "Stolen from Pasadena between 4:30 and 6:30 pm ... | \n", "8 | \n", "rec.motorcycles | \n", "
11314 rows × 3 columns
\n", "