StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
58 lines
1.4 KiB
# reduce-object [](http://badge.fury.io/js/reduce-object)
|
|
|
|
> Reduces an object to a value that is the accumulated result of running each property in the object through a callback.
|
|
|
|
## Install
|
|
#### Install with [npm](npmjs.org):
|
|
|
|
```bash
|
|
npm i reduce-object --save
|
|
```
|
|
|
|
## Run tests
|
|
|
|
```bash
|
|
npm test
|
|
```
|
|
|
|
## Usage
|
|
|
|
Executes the callback function once for each own enumerable property in the object, receiving four arguments:
|
|
|
|
- `acc`: the initial value (or value from the previous callback call),
|
|
- `value`: the of the current property,
|
|
- `key`: the of the current property, and
|
|
- the original `object` over which the function is iterating.
|
|
|
|
```js
|
|
var reduce = require('reduce-object');
|
|
|
|
var a = {a: 'foo', b: 'bar', c: {}};
|
|
|
|
var obj = reduce(a, function (acc, value, key, orig) {
|
|
if (typeof value === 'object') {
|
|
acc[key] = {what: 'huh?'};
|
|
} else {
|
|
acc[key] = value.toUpperCase(); // why?
|
|
}
|
|
return acc;
|
|
}, {});
|
|
|
|
console.log(obj);
|
|
//=> {a: 'FOO', b: 'BAR', c: {what: 'huh?'}};
|
|
```
|
|
|
|
## Author
|
|
|
|
**Jon Schlinkert**
|
|
|
|
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
|
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
|
|
|
## License
|
|
Copyright (c) 2014 Jon Schlinkert, contributors.
|
|
Released under the MIT license
|
|
|
|
***
|
|
|
|
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 20, 2014._ |