Changelog History
-
v1.2.1 Changes
December 27, 20180๏ธโฃ Made some fixes to the
binByComparable()
implementation so ends are not exclusive by default. -
v1.2.0 Changes
December 27, 2018๐ This release has a major correction to the binning API, but it required Kotlin-Statistics to implement its own
Range
interface until Kotlin stdlib will support open ranges.When binning continuous numerical types (e.g.
Double
,BigDecimal
, orFloat
), you no longer provide agapSize
argument as the ranges in the bin model will be end-exclusive. -
v1.1.3 Changes
July 11, 2018๐ This release contains some practical features for randomness and weighted probabilities.
Kotlin-Statistics now has a few helpful extensions to randomly sample elements from an
Iterable<T>
orSequence<T>
.randomFirst()
- Selects one random element but throws an error if no elements are found.randomFirstOrNull()
- Selects one random element but returnsnull
if no elements are found.random(n: Int)
- Selectsn
random elements.randomDistinct(n: Int)
- Selectn
distinct random elements.
Also available are
WeightedCoin
andWeightedDice
utilities which can be helpful to assign probabilities to discretetrue
/false
orT
outcomes. This can be helpful for games, stochastic programming, simulation, and optimization.enum class Move { ATTACK, DEFEND, HEAL, RETREAT}fun main(args: Array\<String\>) { val gameDice = WeightedDice( Move.ATTACK to .60, Move.DEFEND to .20, Move.HEAL to .10, Move.RETREAT to .10 ) val nextMove = gameDice.roll() println(nextMove) }
-
v1.1.2 Changes
April 15, 2018๐ This is a re-release to fix some deployment issues with Kotlin's stdlib dependencies.
-
v1.1.1 Changes
April 14, 2018๐ This release includes some minor fixes to the
NaiveBayesClassifier
as well as some new operators that will return ranges.Sequence<T>.toNaiveBayesClassifier()
Sequence<C: Comparable<C>>.range()
Iterable<C: Comparable<C>>.range()
Sequence<C: Comparable<C>>.rangeBy()
Iterable<C: Comparable<C>>.rangeBy()
Sequence<Int>.intRange()
Iterable<Int>.intRange()
Sequence<T>.intRangeBy()
Iterable<T>.intRangeBy()
Sequence<Long>.longRange()
Iterable<Long>.longRange()
Sequence<T>.longRangeBy()
Iterable<T>.longRangeBy()
Sequence<Double>.doubleRange()
Iterable<Double>.doubleRange()
Sequence<T>.doubleRangeBy()
Iterable<T>.doubleRangeBy()
Sequence<Double>.doubleRange()
Iterable<Double>.doubleRange()
Sequence<T>.doubleRangeBy()
Iterable<T>.doubleRangeBy()
Sequence<Float>.floatRange()
Iterable<Float>.floatRange()
Sequence<T>.floatRangeBy()
Iterable<T>.floatRangeBy()
-
v1.1.0 Changes
April 07, 2018๐ This release has a new
NaiveBayesClassifier
, as well as some generic projection fixes for theBin
andBinModel
types.๐ See README for examples.
val nbc = bankTransactions.toNaiveBayesClassifier( featuresSelector = { it.memo.splitWords().toSet() }, categorySelector = { it.category } ) //TESTval input = BankTransaction(date = LocalDate.of(2018,3,31), amount = 13.99, memo = "NETFLIX VIDEO ON DEMAND #21" ) val result = nbc.predict(input.memo.splitWords().toSet()) println(result) // prints "ENTERTAINMENT"
-
v1.0 Changes
October 29, 2017๐ I'm excited to announce that I've settled on a base set of features and released Kotlin-Statistics 1.0. There have been some major refactorings from the pre-1.0 versions.
- Maven artifact is now called
kotlin-statistics
, notkotlinstatistics
- Most operators have been consolidated to target
Number
, rather than overloads for every numeric input type. - ๐ Many higher order function parameters have been renamed. Please see README for examples.
- โ Unit tests have been written for approximately 96% of the codebase.
I've decided to focus this library primarily on statistics, and steer away from linear algebra and other data science tasks. There are a few exceptions I've decided to keep, such as clustering and linear regression. I'll conservatively expand on these non-statistical features possibly, but I may spin off other projects.
๐ If you have any ideas, please contribute and I'll be happy to consider adding features. Thank you for the enthusiastic support and usage of this library. What started as an experiment to see if Kotlin could be idiomatic for analytical tasks ended up becoming much more than I anticipated. I hope these patterns continue to gain traction and help make Kotlin a platform for data science.
- Maven artifact is now called
-
v0.3.0 Changes
July 08, 2017๐ There are some exciting new features in this release, including clustering algorithms.
๐ KMeans and other clustering algorithms are now included. See README for details.
binMapper
parameters are now calledvalueMapper
.Apache Commons Math 3 is now a dependency.
๐ Operators related to
Short
types have been removed, deemed uncommon and out-of-scope.๐ On the roadmap, operators will get better
Pair
support, and I will explore idiomatic linear algebra with vertices and matrices. -
v0.2.1 Changes
May 28, 2017๐จ This includes some breaking refactors to ensure naming consistency:
- All references to
bucket
are now calledbin
, including parameter names - ๐ Support for
Iterable
andSequence
now exist forbinByXXX()
operators
- All references to
-
v0.1.1 Changes
May 26, 2017๐ This release includes fixes for
binIntBy()
andbinLongBy()
operators, which were adding one extra increment to the first bucket.