Skip to content

Commit

Permalink
Release v0.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
cheminfo-bot committed Jun 30, 2015
1 parent 4860c0c commit 88ef467
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ml",
"version": "0.3.4",
"version": "0.3.5",
"main": [
"dist/ml.js",
"dist/ml.min.js"
Expand Down
23 changes: 14 additions & 9 deletions dist/ml.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* ml - Machine learning tools
* @version v0.3.4
* @version v0.3.5
* @link https://github.com/mljs/ml
* @license MIT
*/
Expand Down Expand Up @@ -44,8 +44,7 @@ NN.SOM = require('ml-som');
/*
Array Utils
*/
var AU = exports.AU = exports.ArrayUtils = {};
AU.ArrayUtils = require('ml-array-utils');
var ArrayUtils = exports.ArrayUtils = exports.AU = require('ml-array-utils');

},{"ml-array-utils":4,"ml-distance":57,"ml-kmeans":58,"ml-matrix":67,"ml-som":69,"ml-stat/array":72,"ml-stat/matrix":73,"ml-svm":74}],2:[function(require,module,exports){
'use strict';
Expand Down Expand Up @@ -231,6 +230,7 @@ module.exports = {
'use strict';

/**
*
* Function that returns a Number array of equally spaced numberOfPoints
* containing a representation of intensities of the spectra arguments x
* and y.
Expand All @@ -239,18 +239,18 @@ module.exports = {
* from: starting point
* to: last point
* numberOfPoints: number of points between from and to
* variant: "slot" or "smooth"
* variant: "slot" or "smooth" - smooth is the default option
*
* The slot variant consist that each point in the new array is calculated
* averaging the existing points between the slot that belongs to the current
* value. The smooth variant is the same but takes the integral of the range
* of the slot and divide by the step size between two points in the new
* array.
* of the slot and divide by the step size between two points in the new array.
*
* @param x
* @param y
* @param options
* @returns {Array} new array with the equally spaced data.
*
*/
function getEquallySpacedData(x, y, options) {

Expand All @@ -262,8 +262,13 @@ function getEquallySpacedData(x, y, options) {

var from = options.from === undefined ? x[0] : options.from;
var to = options.to === undefined ? x[x.length - 1] : options.to;
if(from > to)
throw new RangeError("from option must be less or equal that the to argument.");

var reverse = from > to;
if(reverse) {
var temp = from;
from = to;
to = temp;
}

var numberOfPoints = options.numberOfPoints === undefined ? 100 : options.numberOfPoints;
if(numberOfPoints < 1)
Expand Down Expand Up @@ -363,7 +368,7 @@ function getEquallySpacedData(x, y, options) {
updateParameters();
}

return output;
return reverse ? output.reverse() : output;
}
/**
* Function that calculates the integral of the line between two
Expand Down
8 changes: 4 additions & 4 deletions dist/ml.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ml.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ml",
"version": "0.3.4",
"version": "0.3.5",
"description": "Machine learning tools",
"main": "src/index.js",
"scripts": {
Expand Down

0 comments on commit 88ef467

Please sign in to comment.