Module: FeldtRuby
- Extended by:
- Statistics
- Defined in:
- lib/feldtruby.rb,
lib/feldtruby/logger.rb,
lib/feldtruby/mongodb.rb,
lib/feldtruby/version.rb,
lib/feldtruby/statistics.rb,
lib/feldtruby/annotations.rb,
lib/feldtruby/mongodb_logger.rb,
lib/feldtruby/statistics/fastmap.rb,
lib/feldtruby/statistics/distance.rb,
lib/feldtruby/statistics/clustering.rb,
lib/feldtruby/statistics/array_archive.rb,
lib/feldtruby/statistics/euclidean_distance.rb
Overview
This is the namespace under which we put thingsā¦
Defined Under Namespace
Modules: Annotateable, CompositableDistance, Logging, Normalization, Optimize, SetDistance, Statistics Classes: AllMongoDBLoggers, AverageLinkageMetric, ClusterLinkageMetric, CompleteLinkageMetric, CompositeMetric, Distance, EuclideanDistance, FastMap, HtmlDocGetter, Logger, Metric, MinMaxMeanPerPositionArchive, MongoDBLogger, NgramWordCounter, PositionBasedValueArchive, RCommunicator, SingleLinkageMetric, ValueArchive, WordCounter
Constant Summary collapse
- TopDirectory =
File.dirname(__FILE__).split("/")[0...-1].join("/")
- VERSION =
"0.4.12"
Class Method Summary collapse
-
.fastmap(objects, distance, k = 2) ⇒ Object
Recursively map n-dimensional objects (given as an Array) into a k-dimensional space while preserving the distances between the objects as well as possible.
- .is_mongo_running? ⇒ Boolean
Instance Method Summary collapse
Methods included from Statistics
cdm, chi_squared_test, correlation, density_estimation, ncd, probability_of_same_proportions
Class Method Details
.fastmap(objects, distance, k = 2) ⇒ Object
Recursively map n-dimensional objects (given as an Array) into a k-dimensional space while preserving the distances between the objects as well as possible.
102 103 104 |
# File 'lib/feldtruby/statistics/fastmap.rb', line 102 def self.fastmap(objects, distance, k = 2) FastMap.new(distance, k).run(objects) end |
.is_mongo_running? ⇒ Boolean
7 8 9 10 11 12 13 14 |
# File 'lib/feldtruby/mongodb.rb', line 7 def self.is_mongo_running? begin Mongo::MongoClient.new("localhost", 27017) return true rescue Exception => e return false end end |
Instance Method Details
#euclidean_distance(o1, o2) ⇒ Object
14 15 16 |
# File 'lib/feldtruby/statistics/euclidean_distance.rb', line 14 def euclidean_distance(o1, o2) (@euclidean_distance ||= EuclideanDistance.new).calc(o1, o2) end |