Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
andcastillo committed Jun 10, 2016
2 parents 0414dd2 + 4eb7adf commit 115aee2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 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.12.0",
"version": "0.13.0",
"main": [
"dist/ml.js",
"dist/ml.min.js"
Expand Down
29 changes: 17 additions & 12 deletions dist/ml.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ return /******/ (function(modules) { // webpackBootstrap
Math.SG = __webpack_require__(97);
Math.Matrix = exports.Matrix;
Math.SparseMatrix = __webpack_require__(99);
Math.CurveFitting = __webpack_require__(100);
Math.BellOptimizer = __webpack_require__(100);
Math.CurveFitting = __webpack_require__(101);


// Statistics packages
Expand Down Expand Up @@ -5789,7 +5790,7 @@ return /******/ (function(modules) { // webpackBootstrap
return out;
}

_compute(input) {
_predict(input) {
return this.slope * input + this.intercept;
};

Expand Down Expand Up @@ -5843,26 +5844,30 @@ return /******/ (function(modules) { // webpackBootstrap
'use strict';

class BaseRegression {
compute(x) {
predict(x) {
var y2;
if(Array.isArray(x)){
y2 = new Array(x.length);
for(var i=0;i<x.length;i++){
y2[i]=this._compute(x[i]);
y2[i]=this._predict(x[i]);
}
}
else if(Number.isFinite(x)){
y2 = this._compute(x);
y2 = this._predict(x);
} else {
throw new TypeError('x must be a number or array')
}
return y2;
}

_compute(x) {
_predict(x) {
throw new Error('_compute not implemented');
}

train(options){
//Do nothing for this package
}

/**
* Return the correlation coefficient of determination (r).
* @param x
Expand All @@ -5873,7 +5878,7 @@ return /******/ (function(modules) { // webpackBootstrap
let n = x.length;
var y2 = new Array(n);
for (var i = 0; i < n; i++) {
y2[i]=this._compute(x[i]);
y2[i]=this._predict(x[i]);
}
var xSum = 0;
var ySum = 0;
Expand Down Expand Up @@ -5982,7 +5987,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}

_compute(x) {
_predict(x) {
var y =0;
for(var k = 0; k < this.powers.length; k++) {
y+=this.coefficients[k]*Math.pow(x,this.powers[k]);
Expand Down Expand Up @@ -6094,7 +6099,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}

_compute(x) {
_predict(x) {
return this.A*Math.pow(x,this.M);
}

Expand Down Expand Up @@ -6179,7 +6184,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}

_compute(newInputs) {
_predict(newInputs) {
return this.C*Math.exp(newInputs*this.A);
}

Expand Down Expand Up @@ -6261,7 +6266,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}

_compute(newInputs) {
_predict(newInputs) {
return this.A*Math.pow(newInputs,this.B);
}

Expand Down Expand Up @@ -6342,7 +6347,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
}

_compute(newInputs) {
_predict(newInputs) {
return this.kernel.compute([newInputs], this.inputs).mmul(this.alpha)[0];
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ml",
"version": "0.12.0",
"version": "0.13.0",
"description": "Machine learning tools",
"main": "src/index.js",
"scripts": {
Expand Down Expand Up @@ -51,7 +51,7 @@
"ml-svm": "^1.0.2",
"ml-xsadd": "^1.0.0",
"ml-optimize-lorentzian": "^0.1.3",
"ml-curve-fitting":"^0.0.6"
"ml-curve-fitting": "^0.0.6"
},
"devDependencies": {
"cheminfo-tools": "^1.0.1",
Expand Down

0 comments on commit 115aee2

Please sign in to comment.