<commit_before># Beuron.js<sup>v1.0.0</sup>

Binary neuron. A logic port that learns the most probable logical function from samples. Capable of online learning and handling noisy data.


## Basic example

    > var b = Beuron.create();
    > b.learn([1, 1], 0);
    > b.learn([0, 1], 0);
    > b.learn([1, 0], 0);
    > b.learn([0, 0], 1);
    > b.solve([1, 0]);
    0
    > b.solve([0, 0]);
    1

## API Documentation

### Beuron.create(sizeLimit?)

    > var b = Beuron.create();
    > var c = Beuron.create(6);

The sizeLimit is an optional positive number that defines how quickly old samples will be forgotten when new ones are learned. Set to zero to force solve() results to be based on all the learned samples. Set to 2 to base results on approximately two previous samples for each different sample. Default is zero.

### b.learn(sample, result)

    > b.learn([0, 1], 1);
    undefined

Sample is an array with length of __two__. The elements of the array and also the result must be 0 or 1.

Does not return anything (undefined).
<commit_msg>Minor doc tweaks.<commit_after># Beuron.js<sup>v1.0.0</sup>

Binary neuron. A logic port that learns the most probable logical function from samples. Capable of online learning and handling noisy data.


## Basic example

    > var b = Beuron.create();
    > b.learn([1, 1], 0);
    > b.learn([0, 1], 0);
    > b.learn([1, 0], 0);
    > b.learn([0, 0], 1);
    > b.solve([1, 0]);
    0
    > b.solve([0, 0]);
    1

## API

### Beuron.create(sizeLimit?)

    > var b = Beuron.create();
    > var c = Beuron.create(6);

The sizeLimit is an optional positive number that defines how quickly old samples will be forgotten when new ones are learned. Set to zero to force solve() results to be based on all the learned samples. Set to 2 to base results on approximately two previous samples for each four different sample types. Default is zero.

### b.learn(sample, result)

    > b.learn([0, 1], 1);
    undefined

Sample is an array with length of __two__. The elements of the array and also the result must be 0 or 1.

Does not return anything (undefined).

{'fraction_non_alphanumeric': 0.11700615821885363, 'fraction_numerical': 0.026527711984841308, 'mean_word_length': 3.1821782178217823, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2382891', 'n_tokens_mistral': 695, 'n_tokens_neox': 640, 'n_words': 289}