sampling 1.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 50

Dart library for sampling items

Various algorithms for selection of a subset (a statistical sample) of individuals from within a statistical population to estimate characteristics of the whole population.

Current algorithms:

  • latest N item
  • reservoir sampling

It can also track basic statistics of integer populations.

Usage

A simple usage example:

final sampler = new ReservoirSampler(25, random: new Random.secure());
sampler.addAll(new List.generate(10000, (i) => i));
print(sampler.getSample());

1.0.0

  • Initial version.

example/sampling_example.dart

import 'dart:math';

import 'package:sampling/sampling.dart';

void main() {
  final sampler = new ReservoirSampler(25, random: new Random.secure());
  sampler.addAll(new List.generate(10000, (i) => i));
  print(sampler.getSample());
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sampling: "^1.0.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:sampling/sampling.dart';
  
Version Uploaded Documentation Archive
1.0.0 May 16, 2018 Go to the documentation of sampling 1.0.0 Download sampling 1.0.0 archive

Analysis

We analyzed this package on Jul 13, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
50
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:sampling/sampling.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.1.0 <2.0.0
Dev dependencies
test ^0.12.30