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

luma-prioritizer

v1.0.5

Published

An Algorithm for ranking patients based on past behavior

Downloads

2

Readme

Luma Prioritizer

This algorithm let's you generate a list of patients for appointment based on their past behavioral data. The fields considered in each of the instance of the patient record are age, location, acceptedOffers, canceledOffers and averageReplyTime.

To get the desired result

  1. The data set is refined by a method called refineData, so as to exclude record instances that have missing fields such as averageReplyTime.
  2. scoreAll is used to score each record instance that has all the fields required in the model. The scoreAll method individually calls methods such as scoreByAverageReplyTime, scoreByAge, scoreByLocation and scoreByAcceptedOffers, the resulting values from each of these methods sum up to 100% which is then converted to a score ranging from 1 t0 10.
  3. arrange method is called with an argument of desc which means descending order, this method sort patient records in descending order, this means patients with great scores are at the top of the list.
  4. Items collected by the refineData method in step 1 are randomly inserted into the resulting list of patients in step 3 with the help of a method called includePatientsWithIncompleteData .

To run the algorithm

Clone the Repo git clone https://github.com/VictorMaria/luma-prioritizer.git

Navigate into the directory cd luma-prioritizer

Install dependences ```npm install``

Run tests npm test

Run the build npm run build

In the root directory of the repo, locate playground.ts file which already has Prioritizer class imported You can uncomment the sample code and run npm run play or instantiate Prioritizer class with your own arguments, call startPipeline method on the instance and run npm run play on the terminal to see the output.

const result = new Prioritizer(patientData, '-63.1150', '46.7110', 'averageReplyTime');
console.log(result.startPipeline());

Sample of an instance from the final output

{
    id: '174d1896-7da4-438a-8a85-e620a5f893bb',
    name: 'Maxime Emard',
    location: { latitude: '-75.9576', longitude: '-114.3718' },
    age: 77,
    acceptedOffers: 44,
    canceledOffers: 18,
    averageReplyTime: 1490,
    finalScore: 7.658064516129034
}

You can also call the individual methods on an instance of prioritizer to play around. startPipeline method is just a method that calls other methods in a certain order to ensure the correct data is generated.

distanceInKMBetweenTwoCoorindates method in the Utility class

It should be noted that this method calcuates the shortest distance between two coordinates and it does not take into consideration the additional distance the possible route between the coordinates may introduce.