Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nignatiadis/statsdiscretizations.jl
https://github.com/nignatiadis/statsdiscretizations.jl
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nignatiadis/statsdiscretizations.jl
- Owner: nignatiadis
- License: mit
- Created: 2021-03-11T00:07:31.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T06:17:02.000Z (8 months ago)
- Last Synced: 2024-11-21T09:05:44.251Z (about 2 months ago)
- Language: Julia
- Size: 119 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StatsDiscretizations
[![Build Status](https://github.com/nignatiadis/StatsDiscretizations.jl/workflows/CI/badge.svg)](https://github.com/nignatiadis/StatsDiscretizations.jl/actions)
[![Coverage](https://codecov.io/gh/nignatiadis/StatsDiscretizations.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/nignatiadis/StatsDiscretizations.jl)Julia package to simplify discretization operations that are routine in statistical tasks. The key idea of the package is that a lot of statistical operations
can be simplified by giving first class support to Intervals from the [IntervalSets.jl](https://github.com/JuliaMath/IntervalSets.jl) package.## Discretizers
Let ℐ the set of all intervals on ℝ. The key idea is that a `discretizer` acts as a function from ( subset of ) ℝ ∪ ℐ ↦ ℐ with the following properties:
* Callable as `discretizer(z)` and broadcastable `discretizer.(zs)`.
* Returns intervals: `typeof(discretizer(z)) <: AbstractInterval`.
* Idempotent: `discretizer(discretizer(z)) == discretizer(z)`.The discretizers that are currently implemented are the following
### `RealLineDiscretizer{:open,:closed}(grid), RealLineDiscretizer{:closed,:open}(grid)`
This is a discretizer that partitions the whole real line into intervals with breakpoints at `grid`. For example:
```julia
julia> using StatsDiscretizations
julia> discr = RealLineDiscretizer{:open,:closed}(-2:0.1:2)julia> discr(-5)
-Inf..-2.0 (open–closed)julia> discr(0.05)
0.0..0.1 (open–closed)julia> discr(0.00)
-0.1..0.0 (open–closed)
```