Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

license and README

  • Loading branch information...
commit 3abcab65f801c6125ff15c77d9cab596b1510d02 1 parent 937c6c2
@beerriot authored
Showing with 51 additions and 0 deletions.
  1. +27 −0 README.org
  2. +24 −0 src/baseball.erl
View
27 README.org
@@ -0,0 +1,27 @@
+Computing Baseball Stats using Riak Map/Reduce
+
+* What is this?
+
+This project is primarily an example of using Riak
+(http://github.com/basho/riak) and luwak_mr
+(http://github.com/beerriot/luwak_mr) to compute baseball statistics.
+
+* How do I use it?
+
+First, grab the game event files by decade from the Retrosheet
+archive: http://www.retrosheet.org/game.htm. Unzip them into
+usefully-named directories (e.g. "1950s").
+
+Setup Riak, then clone luwak_mr and this project, build them, and add
+them to Riak's code path.
+
+Load the Retrosheet data into Riak by attaching to the Riak console
+and using baseball:load_events(Directory), where Directory is the path
+to one of your unzipped archives (e.g. "/home/bryan/baseball/1950s").
+
+Compute the batting average for any player by attaching to the Riak
+console and using baseball:batting_average(File, PlayerID), where File
+is the last component of the path that you used in your load_events
+call (e.g. 1950s), and PlayerID is the 8-character identifier of any
+player (see the .ROS files in your unpacked archive, or the Retrosheet
+docs for information about player IDs).
View
24 src/baseball.erl
@@ -1,3 +1,27 @@
+%% -------------------------------------------------------------------
+%% baseball: utilities for computing baseball stats on Riak
+%%
+%% This file is provided to you under the Apache License,
+%% Version 2.0 (the "License"); you may not use this file
+%% except in compliance with the License. You may obtain
+%% a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing,
+%% software distributed under the License is distributed on an
+%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+%% KIND, either express or implied. See the License for the
+%% specific language governing permissions and limitations
+%% under the License.
+%%
+%% -------------------------------------------------------------------
+
+%% @doc Compute baseball stats using Riak Map/Reduce.
+%%
+%% This module works with data from the Retrosheet archive
+%% (http://www.retrosheet.org/) to compute baseball statistics
+%% (currently only batting average).
-module(baseball).
-export([
Please sign in to comment.
Something went wrong with that request. Please try again.