Metadata-Version: 2.1
Name: psuffix-trees
Version: 1.0.0
Summary: A Python port of the Matlab probabilistic suffix trees and automata library by Markowitz
Author-email: Russell McLoughlin <russ.mcl@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Russell McLoughlin
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/rmcl/psuffix-trees
Keywords: pst,probabilistic suffix trees,python
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21

# psuffix-trees

A Python port of the Matlab probabilistic suffix trees and automata library by Markowitz (https://github.com/jmarkow/pst)

This port is an implementation probabilistic suffix trees by Ron, Singer and Tishby 1996.

## How to use

### Simple Example

You'll need a dataset of sequences. There is a nice example in `pypst/fixtures/output_symbols.json` if you want something to play around with.

```
dataset = [
    "VHDEFAZDEFABGNVbEFKJaSAHDHD",
    "BN",
    "CTCQMTJcO",
    ...
]

from pypst import PST

pst = PST(
    L = 2,
    p_min = 0.0073,
    g_min = .01,
    r = 1.6,
    alpha = 17.5,
)

pst.fit(dataset)

pst.tree
```

### Any sequence that is iterable is acceptable

Setup your dataset of sequences
```
dataset = [
    "VHDEFAZDEFABGNVbEFKJaSAHDHD",
    "BN",
    "CTCQMTJcO",
    ...
]
```

Your dataset entries can be any sequence whether its string, list or tuple.

```
dataset = [
    ['1','2','3'],
    ['2','4','7','8']
    ['5','1','2']
]
```
