New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lite-statistics

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lite-statistics

  • 2.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Lite::Statistics

Gem Version Build Status

Lite::Statistics is a library for generate statistics from collections of data points.

Installation

Add this line to your application's Gemfile:

gem 'lite-statistics'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lite-statistics

Table of Contents

Configurations

Any and all monkey patches must be explicitly included anywhere you want to use it.

To globally use the monkey patches, just create an initializer requiring them.

rails g lite:statistics:install will generate the following file: ../config/initalizers/lite_statistics.rb

They can be disabled by commenting any of them out.

# frozen_string_literal: true

require 'lite/statistics/monkey_patches'

Descriptive

Sample|Population calculations will have a shorthand alias that defaults to sample.

Ex: variance => sample_variance

Summary
Count
Distribution
Central tendency
Dispersion
Spread
Shape

Monkey patches

Including monkey patches will give you Enumerable access to statistics.

[1, 2, 3, 1].mode #=> 1

Benchmarks

All benchmarks are executed using the baseline summary (exact same calculations for each) and the full summary (all available calculations for each). Each is generated using an array containing 1 million random integers on the 2.6.3 Ruby version.

View how each compares to other libs by running the benchmarks.

Baseline summaries
Library# of CalculationsIPSSpeed
lite-statistics132.5 i/s---
descriptive_statistics130.6 i/s4.16x slower
descriptive-statistics131.8 i/s1.40x slower
statistica13---Too slow to run
Full summaries
Library# of CalculationsIPSSpeed
lite-statistics221.0 i/s---
descriptive_statistics130.6 i/s1.72x slower
descriptive-statistics160.9 i/s1.10x slower
statistica19---Too slow to run

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lite-statistics. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Lite::Statistics project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 22 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc