Skip to content

Commit

Permalink
[UPDATE] README.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Mar 28, 2015
1 parent f5e13be commit 28c3237
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Expand Up @@ -213,7 +213,7 @@ The method accepts the following `options`...

* __accessor__: accessor `function` for accessing `x_i` values.
* __ci__: `boolean` indicating whether to compute confidence intervals for predicted responses. Default: `false`.
* __copy__: `boolean` indicating whether to return a new array when computing predicted responses. Default: `true`.
* __copy__: `boolean` indicating whether to return a new `array` when computing predicted responses. Default: `true`.

For a non-numeric input `array`, provide an accessor `function` for accessing `x_i` values.

Expand Down Expand Up @@ -255,6 +255,13 @@ console.log( x === prediction );
// returns true
```

__Note__: the method returns the following outputs...
* if provided a single input value and `opts.ci === false`, the method returns a `numeric` value.
* if provided an input value `array` and `opts.ci === false`, the method returns a `numeric array`.
* if `opts.ci === true`, the method returns an `array` of `arrays`, where each sub-array is a 3-element tuple
```
[ prediction, lower_bound, upper_bound ]
```



Expand Down
2 changes: 1 addition & 1 deletion lib/model.js
Expand Up @@ -160,7 +160,7 @@ function createModel( x, y, slope, yint ) {
* @param {Object} [opts] - method options
* @param {Function} [opts.accessor] - accessor function for accessing array values
* @param {Boolean} [opts.ci=false] - boolean indicating whether to compute confidence intervals for predicted responses
* @param {Boolean} [opts.copy=true] - boolean indicating whether to return a new array when generating the predictions
* @param {Boolean} [opts.copy=true] - boolean indicating whether to return a new array when computing predicted responses
* @returns {Number|Array|Array[]} prediction(s)
*/
model.predict = function( val, opts ) {
Expand Down

0 comments on commit 28c3237

Please sign in to comment.