Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/vectorizer/src/utils/random/mod.ts>useWeighted

Machine Learning utilities for TypeScript
Latest
function useWeighted
import { useWeighted } from "https://deno.land/x/vectorizer@v0.7.5/src/utils/random/mod.ts";

Roll one from an array of weighted choices.

Parameters

choices: WeightedChoice<ItemType>[]
  • Choices to roll from.

Returns

WeightedChoice<ItemType>

Item rolled.