sampling 1.0.1

  • 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.1

  • Dart 2 support.

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.1

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.1 Sep 9, 2018 Go to the documentation of sampling 1.0.1 Download sampling 1.0.1 archive
1.0.0 May 16, 2018 Go to the documentation of sampling 1.0.0 Download sampling 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.6

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 <3.0.0
Dev dependencies
test ^1.3.0