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

Feature Extraction and Feature Selection in TypeScript
Go to Latest
function useWeighted
import { useWeighted } from "https://deno.land/x/vectorizer@v0.3.7/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.