0.2.0 • Published 9 years ago

rosenblatt v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

rosenblatt

Evaluation of neural networks created using the R package nnet

Install

npm install rosenblatt

Usage

// iris dataset predictions, linout=false and softmax=true

var n = [4, 3, 3];
var w = [
  0.442558222914919, 2.10022864771489, 2.23573368675063, 0.217011021706292, -0.746385865240631, 
  16.237501574711, -7.35231915240128, -39.6550412545003, 23.367137261562, 12.0959933215026, 
  2.09031961798775, 0.732287302925808, 9.45112011208204, 3.47187412988877, -28.7113865455258, 
  5.29890720801739, 2.26900991549321, -0.527321775178841, 4.77502921656347, 11.8773486358539, 
  23.7493404235415, -30.2503734237308, -15.5200877026677, 1.77238996927405, 3.48199453943633, 
  19.849897008999, 10.9782593232489, 5.51905185997946, 20.8842685255224, -17.9853358352868, 
  -7.46019743393322, -6.96998523147064, -5.13292446063638, -19.7663635630998, -16.4446218975222, 
  -17.6183047231164, -44.8940992763018, 49.5383750371739, 21.7998980223325
];
var network = new rosenblatt.Network(n, w, false, true);
var p = network.predict([
  [5, 3, 1.6, 0.2],
  [5, 2, 3.5, 1],
  [6, 3, 4.8, 1.8]
]);
[
  [0.9999997643608252, 2.3563917487658202e-7, 2.770550760805804e-113],
  [2.7571280582773113e-8, 0.9999999724256968, 3.022679723245865e-12],
  [3.40281375514018e-17, 0.000020985275552418204, 0.9999790147244476]
]
0.2.0

9 years ago

0.1.0

9 years ago