🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-param-grid

Generate a list of possible paramaters combinations. Useful for example for hyper-paramater grid search.

1.0.0
latest
Version published
Weekly downloads
249
20.87%
Maintainers
1
Weekly downloads
 
Created

param-grid

NPM version build status Test coverage npm download

Generate a list of possible paramaters combinations. Useful for example for hyper-paramater grid search..

Installation

$ npm install --save ml-param-grid

Usage

import paramGrid from 'ml-param-grid';

// paramGrid is a generator function so it returns an iterator
for(let param of paramGrid({
  param1: ['x', 'y'],
  param2: [4, 2],
  param3: true
}) {
  console.log(param);
};
// result is
// {param1 : 'x', param2: 4, param3: true}
// {param1 : 'x', param2: 2, param3: true}
// {param1 : 'y', param2: 4, param3: true}
// {param1 : 'y', param2: 2, param3: true}

// Get the result directly as an array
Array.from(paramGrid({
  p: [1, 2]
})); // [{p: 1}, {p: 2}]

License

MIT

FAQs

Package last updated on 01 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts