Skip to content

Commit

Permalink
fixed json, added python info
Browse files Browse the repository at this point in the history
  • Loading branch information
randogoth committed Mar 1, 2024
1 parent f74d9f0 commit 1ebfbf5
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ It is an algorithm that analyzes a one-dimensional dataset of integers to identi

## Building

With a Rust and Cargo environment set up, simply run:

```sh
$ cargo build
$ cargo build --release
```

## Usage
Expand All @@ -27,34 +29,34 @@ The tool outputs a JSON string that includes details about the identified attrac
```json

[
...
//...
{
"elements": [ 722, 722, 722, 725, 725, 726, 726, 726],
"start": 722,
"end": 726,
"span_length": 4,
"num_elements": 8,
"centroid": 724.0,
"z_score": 1.19528
},
{
"elements": [ 722, 722, 722, 725, 725, 726, 726, 726],
"start": 722,
"end": 726,
"span_length": 4,
"num_elements": 8,
"centroid": 724.0,
"z_score": 1.19528
},
{
"elements": [],
"start": 732,
"end": 740,
"span_length": 8,
"num_elements": 0,
"centroid": 736.0,
"z_score": -1.13359
},
...
"elements": [],
"start": 732,
"end": 740,
"span_length": 8,
"num_elements": 0,
"centroid": 736.0,
"z_score": -1.13359
},
//...
]
```

### From a File

To analyze a dataset from a file, provide the filename as an argument, followed by the factor and minimum cluster size parameters
```sh
lyagushka filename.txt 1.5 6
lyagushka random_values.txt 1.5 6
```
(= '*Attractor clusters need to have at least 6 numbers with 1.5 times the mean density, void gaps need to be at leat 1.5 times the mean gap size wide*')

Expand All @@ -63,6 +65,9 @@ lyagushka filename.txt 1.5 6
Alternatively, you can pipe a list of integers into the tool, followed by the factor and minimum cluster size.

```sh
echo "1\n2\n10\n20" | lyagushka 0.5 2
cat random_values.txt | lyagushka 0.5 2
```

## Python Module

If you need lyagushka in a Python environment, check out the 'Python' branch of this repository

0 comments on commit 1ebfbf5

Please sign in to comment.