npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

test-result-normalizer

v0.1.4

Published

A normalizer for tests results

Downloads

2

Readme

test-result-normalizer

A data normalizer

Getting Started

Install the module with: npm install test-result-normalizer

The goal of this project is to apply smart normalizing on some of the component tests.

Objective

  • Look at the data/init_data.json data to see a sample of different test data.
  • The final result should be similar to the data/final_data.json.
  • The task at hand is to apply smart normalizing process on a given payload that can find "patterns" and convert it to a normalized form.
  • The data/nomalize.numbers contains the set of the reporting name/test name and the expected normalized form (shaded in green).
  • The normalization will be applied at two levels -

    Name normalization

    Unit normalization along with value conversion

  • The unit conversions are harder as it would need a way to identify the universe of incoming unit types and the normalized value. A good reference to start with this is: http://www.hl7.de/download/documents/ucum/ucumdata.html
  • Many tests in components will not have a normalized form - in these cases, just copy it over to allResults.
  • The name matching will need some fuzzy matches applied.

To train every time the training-set changes:

data/training-set.json is the main file which houses the training data. As our normalization pipeline become better over time, we will be likely moving this from a file into something more scalable like hbase/cassandra/etc.

The lib/train/limdu-trainer.js will train on this set and the output of this training is cached in data/limdu-trained-classifier-string.json

Here are the steps to build the limdu-trained-classifier-string.json each time there is a change to training-set.json

var TrainingSet = require('./lib/train/limdu-trainer');
var ts = new TrainingSet();
var cls = ts.createClassifier();
ts.train();

// Save the file
ts.saveStringAsTrainedSet(function(err, res) { console.log('Trained and saved!', err, res);});

To use the classifier:

var testNameNormalizer = require('./lib/TestNameNormalizer');

testNameNormalizer.normalizeName('Hemoglobin count is awesome'); // => 'hemoglobin level'
testNameNormalizer.normalizeName('Hemoglobin count is a1c in reading'); // => 'hemoglobin a1c'
testNameNormalizer.normalizeName('Hemogobulin count isin reading'); // => '' Typo but cannot yet predict
testNameNormalizer.normalizeName('count of rbc'); // => 'red blood cell count'
testNameNormalizer.normalizeName('count of blood cells'); // => ''
testNameNormalizer.normalizeName('count of blood cells that are red'); // => 'red blood cell count'

To use the unit/value normalizer:

var testUVNormalizer = require('./lib/TestUnitValueNormalizer');

testUVNormalizer.normalizeUnitAndValue('hcv viral load', 'IU/mL', '3'); // => { normalized: true, unit: 'IU/mL', value: 3 }
testUVNormalizer.normalizeUnitAndValue('white blood cell count', 'x10-3', '7.3'); // => { normalized: true, unit: 'mcL', value: 7300 }
testUVNormalizer.normalizeUnitAndValue('white blood cell count', 'K/uL', '4.62'); // => { normalized: true, unit: 'mcL', value: 4620 }
testUVNormalizer.normalizeUnitAndValue('neutrophils', 'x10^9/L', '3.32'); // => { normalized: true, unit: '10^9/L', value: 3.32 }
testUVNormalizer.normalizeUnitAndValue('neutrophils', '10(9)/L', '3.32'); // => { normalized: true, unit: '10^9/L', value: 3.32 }
testUVNormalizer.normalizeUnitAndValue('white blood cell count', 'invalidUnit', '4.62'); // => { normalized: false, unit: 'invalidUnit', value: '4.62' }