
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
compute-argmax
Advanced tools
Computes the maximum value of a numeric array and returns the corresponding array indices.
Computes the maximum value of a numeric array and returns the corresponding array indices.
$ npm install compute-argmax
For use in the browser, use browserify.
To use the module,
var argmax = require( 'compute-argmax' );
Computes the maximum value of a numeric array
and returns the corresponding array
indices.
var data = [ 3, 2, 5, 2, 5 ];
var idx = argmax( data );
// returns [2,4]
var argmax = require( 'compute-argmax' );
// Simulate some data...
var data = new Array( 100 );
for ( var i = 0; i < data.length; i++ ) {
data[ i ] = Math.round( Math.random()*100 );
}
var idx = argmax( data );
console.log( idx );
To run the example code from the top-level application directory,
$ node ./examples/index.js
Unit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:
$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
$ make view-cov
Copyright © 2014. Athan Reines.
FAQs
Computes the maximum value of a numeric array and returns the corresponding array indices.
The npm package compute-argmax receives a total of 619 weekly downloads. As such, compute-argmax popularity was classified as not popular.
We found that compute-argmax demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.