Skip to content

reddavis/Data-Prep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Prep

Data Prep is a gem that makes extracting: training, testing and validation data nice and simple.

All you have to do is give it your data and Data Prep will try to spread your classes as evenly as possible in a 50:25:25 (training, testing, validation) split.

Install

sudo gem sources -a http://gemcutter.org
sudo gem install date_prep

Example

ham = [[1, 0.5]] * 20
spam = [[0, 0.2]] * 20
data_prep = DataPrep.new(1 => ham, 0 => spam)

data_prep.testing.size
   #=> 10
data_prep.validation.size
   #=> 10
data_prep.training.size
   #=> 20

# To make training easy, Data Prep places the data's class
# along side the piece of data

data_prep.training[0].inspect
   #=> [[1, 0.5], [1]] == [[data], [output]]

Copyright © 2009 Red Davis. See LICENSE for details.

About

Helps you prepare your data for machine learning

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages