GODPAPER | All Packages | All Classes | Index | Frames No Frames |
TokenStats

Package | com.suckatmath.machinelearning.markov
Class | public class TokenStats
Inheritance | TokenStats Object

collection of tokens and associated stats and utility methods

Public Methods

| Method | Defined By
--- | --- | ---
|  | TokenStats() constructor | TokenStats
|  | addToken(t:*):void add a token for data. | TokenStats
|  | getProbability(t:*):Number get probability of a token | TokenStats
|  | getRandomToken():* get a random token by weighted random choice. | TokenStats
|  | toString():String get a string representation | TokenStats

Constructor Detail

TokenStats | () | Constructor

`public function TokenStats()`

constructor

Method Detail

addToken | () | method

`public function addToken(t:*):void`

add a token for data. increments existing TokenEntry if already seen

Parameters

| `t:*`

getProbability | () | method |

`public function getProbability(t:*):Number`

get probability of a token

Parameters

| `t:*`

Returns

| `Number` —

getRandomToken | () | method |

`public function getRandomToken():*`

get a random token by weighted random choice.

Returns

| `*` —

toString | () | method |

`public function toString():String`

get a string representation

Returns

| `String` —

Thu Jan 16 2014, 01:11 PM +08:00