# @iazero/wisardjs

> A set of Learning Models based on WiSARD

Latest version **1.0.5** (published 2018-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @iazero/wisardjs
pnpm add @iazero/wisardjs
yarn add @iazero/wisardjs
bun add @iazero/wisardjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2018-06-21 |
| First published | 2018-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 978.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Aluizio Lima Filho |
| Maintainers | aluizio |
| Keywords | wisard |

## Links

- npm: https://www.npmjs.com/package/@iazero/wisardjs
- Repository: https://github.com/aluiziolimafilho/wisardjs
- Homepage: https://github.com/aluiziolimafilho/wisardjs#readme
- Issues: https://github.com/aluiziolimafilho/wisardjs/issues
- npm.io page: https://npm.io/package/@iazero/wisardjs

## Recent versions

- 1.0.5 (latest) — 2018-06-21
- 1.0.4 — 2018-06-21
- 1.0.3 — 2018-06-18
- 1.0.2 — 2018-06-18
- 1.0.1 — 2018-06-18

## README

# wisardjs

## Description
This is a project to make available the different models based on WiSARD, with high performance, easy to use and to install 
and following a pattern of use. These provided models are machine learning models, with supervised, unsupervised and 
semi-supervised learning.

## to install

    npm i @iazero/wisardjs

## to use

### WiSARD

```javascript
    var lib = require('@iazero/wisardjs'); // import the module
    
    var w = new lib.Wisard(3); // instanciate a wisard object
    // The first parameter is the address size
    // the second parameter is optional as {verbose: true} can be passed
    
    // load input data, just zeros and ones  
    var X = [
          [1,1,1,0,0,0,0,0],
          [1,1,1,1,0,0,0,0],
          [0,0,0,0,1,1,1,1],
          [0,0,0,0,0,1,1,1]
        ];

    // load label data, which must be a string array
    var y = [
          "cold",
          "cold",
          "hot",
          "hot"
        ];
        
     w.train(X,y); // train data
     
     var output_val = w.classify(X); // classify data
     
     var output = lib.utils.vecFromVal(output_val); // convert the output_val object to a common vector in js;
```

### ClusWisard

```javascript
    var lib = require('@iazero/wisardjs'); // import the module
    
    var clus = new lib.ClusWisard(3, 0.1, 10, 3); // instanciate a wisard object
    // The first parameter is the address size
    // The second parameter is the min score accept to train
    // The third parameter is the maximum number of trainings in each class
    // The forth parameter is the maximum number of discriminator by cluster, for limitate the cosume of memory.
    // the last parameter is optional as {verbose: true} can be passed
    
    // load input data, just zeros and ones  
    var X = [
          [1,1,1,0,0,0,0,0],
          [1,1,1,1,0,0,0,0],
          [0,0,0,0,1,1,1,1],
          [0,0,0,0,0,1,1,1]
        ];

    // load label data, which must be a string array
    var y = [
          "cold",
          "cold",
          "hot",
          "hot"
        ];
        
     clus.train(X,y); // train data supervised
     
     // load label data, for semi-supervised learning
     var y2 = {
        '1': "cold",
        '3': "hot"
     };
      
     clus.train(X,y2); // train data semi-supervised
      
     // or you can train unsupervised too
     clus.trainUnsupervised(X);
     
     var output_val = clus.classify(X); // classify data to supervised and semi-supervised
     
     var output_val = clus.classifyUnsupervised(X); // classify data to unsupervised
     
     var output = lib.utils.vecFromVal(output_val); // convert the output_val object to a common vector in js;
```

## to uninstall

    npm uninstall @iazero/wisardjs

## Documentation
documentation in development...

---
_Source: https://npm.io/package/@iazero/wisardjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
