dwarf 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/README.md +50 -0
  2. data/dwarf.gemspec +2 -2
  3. data/lib/dwarf/version.rb +1 -1
  4. metadata +4 -4
data/README.md CHANGED
@@ -0,0 +1,50 @@
1
+ # Dwarf Classifying
2
+
3
+ Dwarf provides a decision tree learning tool initially targeting
4
+ classification of Rails 3 ActiveRecord objects. Dwarf is largely
5
+ agnostic of types so long as they implement a few methods.
6
+
7
+ ## Install
8
+
9
+ gem install dwarf
10
+
11
+ This will install dwarf.
12
+
13
+ ## Classifying
14
+
15
+ Dwarf targets the interactive Rails console for the time being,
16
+ though there is nothing preventing it from being used in your code as
17
+ well. Suppose you have some records (record1, record2, ... , recordN)
18
+ that you know the classifications of. Instantiate a Classifier, inform
19
+ the instance of the classifications via the add_example method, and
20
+ then call learn!. The classifier will build a decision tree from your
21
+ examples as well as a classify method to classify arbitrary instances
22
+ you hand it.
23
+
24
+ Teaching:
25
+
26
+ classifier = Dwarf::Classifier.new()
27
+ classifier.add_example(record1, :good)
28
+ classifier.add_example(record2, :good)
29
+ classifier.add_example(record3, :bad)
30
+ .
31
+ .
32
+ .
33
+ classifier.add_example(recordN, :bad)
34
+ classifier.learn!
35
+
36
+ Classifying
37
+
38
+ classifier.classify(record1) => :good
39
+ classifier.classify(unseen_record) => :good
40
+
41
+ Dwarf will make a best guess attempt to classify records it has not
42
+ seen yet. If the features of a record are not sufficient to classify
43
+ it (e.g. two or more records have the same features, but different
44
+ classifications) Dwarf will always guess the classification it has
45
+ seen most often for that particular feature set.
46
+
47
+ ## Contribute
48
+
49
+ Fork the dwarf project on github (http://github.com/aredington/dwarf),
50
+ document your changes, and then send a pull request.
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
8
8
  s.authors = ["Alex Redington"]
9
9
  s.email = ["aredington@gmail.com"]
10
10
  s.homepage = "http://github.com/aredington/dwarf"
11
- s.summary = "C4.5 for ActiveRecord objects"
12
- s.description = "Dwarf is an implementation of the C4.5 algorithm targeted for use in the Rails 3 console environment for classifying ActiveRecord objects."
11
+ s.summary = "Decision tree learning for ActiveRecord objects"
12
+ s.description = "Dwarf is an implementation of decision tree learning algorithms targeted for use in the Rails 3 console environment for classifying ActiveRecord objects."
13
13
 
14
14
  s.required_rubygems_version = ">= 1.3.6"
15
15
  s.rubyforge_project = "dwarf"
@@ -1,3 +1,3 @@
1
1
  module Dwarf
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alex Redington
@@ -62,7 +62,7 @@ dependencies:
62
62
  version: 2.0.1
63
63
  type: :development
64
64
  version_requirements: *id003
65
- description: Dwarf is an implementation of the C4.5 algorithm targeted for use in the Rails 3 console environment for classifying ActiveRecord objects.
65
+ description: Dwarf is an implementation of decision tree learning algorithms targeted for use in the Rails 3 console environment for classifying ActiveRecord objects.
66
66
  email:
67
67
  - aredington@gmail.com
68
68
  executables: []
@@ -117,6 +117,6 @@ rubyforge_project: dwarf
117
117
  rubygems_version: 1.3.7
118
118
  signing_key:
119
119
  specification_version: 3
120
- summary: C4.5 for ActiveRecord objects
120
+ summary: Decision tree learning for ActiveRecord objects
121
121
  test_files: []
122
122