analysis_prep v0.1.2 AnalysisPrep

Analysis preparation for data series.

Incorporates the excellent elixir-statistics with the types of things needed for exploratory analysis and preparing to use data in machine learning algorithms.

Summary

Functions

choose(n, c)
combinations(list, n \\ 2)
cross(a, b)
frequency(list, base \\ %{})
is_range(object)

Test for a range.

A range is implemented with a struct, but behaves differently enough we need to restrict our program flow to handle things correctly.

Examples

iex> is_range 1..5
true
joint(a, b)
label(list)
normalize(object, max \\ nil)
one_hot(list)
p(event, space)
precision(list)
precision(list) :: list

Calculate the precision from a series of values.

Precision is the inverse of the variance, used in some Bayesian libraries for normal distributions instead of standard deviation.

Examples

iex> variance([1,2,3,4])
1.25

iex> precision([1,2,3,4])
1 / 1.25

iex> precision([1,2,3,4])
0.8

iex> precision([])
[]
sample(list, n \\ 1)
save(filename, data)

Save an array of arrays to a file

Examples

iex> save("/tmp/foo.csv", [["a","b"],[1,2],[3,4]]) && File.rm("/tmp/foo.csv")
:ok
scale(list, opts \\ [])
such_that(predicate, space)
sum_map(map)

values of a map or defer to Statistics.sum

Examples

iex> sum_map(%{a: 1, b: 2})
3
summary(list, type \\ :continuous)