Skip to content

Commit

Permalink
Revised style and fixed filenames for Chapter 10 code.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmyleswhite committed Feb 17, 2012
1 parent 05c1bb5 commit 48df06a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions 10-Recommendations/chapter10.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
# working directory for the console to whereever you have saved this file prior to running.
# Otherwise you will see errors when loading data or saving figures!


# First code snippet
df <- read.csv('data/example_data.csv')
df <- read.csv(file.path('data', 'example_data.csv'))

head(df)
# X Y Label
Expand Down Expand Up @@ -82,7 +81,7 @@ rm('knn') # In case you still have our implementation in memory.

library('class')

df <- read.csv('data/example_data.csv')
df <- read.csv(file.path('data', 'example_data.csv'))

n <- nrow(df)

Expand Down Expand Up @@ -114,7 +113,7 @@ sum(predictions != test.y)
#[1] 16

# Eighth code snippet
installations <- read.csv('data/installations.csv')
installations <- read.csv(file.path('data', 'installations.csv'))

head(installations)
# Package User Installed
Expand Down

0 comments on commit 48df06a

Please sign in to comment.