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

benefit-prediction-service

v1.0.4

Published

Benefit Prediction Service Repo

Downloads

4

Readme

Plan Prediction Service

The plan prediction service utilizes ML/AI techniques to generate plans for groups based on what plans were historically generated. Currently there are two methods for predicting the plan, baseline and ML/model based.

The baseline method for predicting the plan is to predict the most frequently observed value for each benefit slug. This will not be correct every time but is a good starting place and is easy to implement.

The model based method for predicting the plan makes use of Catboost models which are gradient boosted trees with optimizations for categorical data. The benefits being predicted by these models are determined by a variance threshold. This threshold filters out benefits that are a single value over x% of the time. Another threshold, the count threshold, is used to filter out the infrequently observed combinations of benefit values. The combinations of the 2 threshold values will determine what benefits are predicted and the possible values for the predictions. In some cases there is no benefit to generating a model since the benefits selected do not vary enough to observe value, in these cases only baseline results are returned.

Environment Variables

MLFLOW_TRACKING_URI - MlFlow Tracking Server that has the Model Registry where the models are logged

MODEL_NAME_ROOT - root name of the models to be served. Default: _all_benefits_grouped

MODEL_STAGE - Stage of models to be used. Choices: STAGING, PRODUCTION Default: PRODUCTION

Required Permissions

The s3 bucket used by ML Flow as an artifact store must also be accessed in the service

Models

The models used in this services are named in the MLFlow Model Registry using the following naming convention.

pl*{MODEL_NAME_ROOT}

If a model cannot be found for a registered product line in the under the correct tag, a model will not be loaded and only the baseline plan prediction will be generated for that product line.

Development Enviroment Requirements

  • AWSCLI - providing credentials and access to S3. Must be configured for MFA if using IAM credential.
  • docker - used to run the container locally

Running the docker container

The service API runs on port 8001 in the container using HTTP, HTTPS is currentlly not being used for this service. The port forwared out of the container so that the API may be accessed by client connections.

If running the service from your development enviroment, the docker container will need access to an AWS credentials store so that a connection can be made to model files in S3. The bucket and file names used by the service are determined at runtime via MODEL_STAGE and MLFlow tagging.

You can start the service without the mlfow or the access to s3 but only the most common values will be predicted.

Docker command tested

docker run --name benefit-prediction-test -p 8001:80 --env MLFLOW_TRACKING_URI=http://ec2-34-217-53-154.us-west-2.compute.amazonaws.com -v ${HOME}/.aws/credentials:/root/.aws/credentials:ro benefit-prediction