Skip to content

Commit

Permalink
update docs and prepare for 0.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ozancicek committed Sep 13, 2020
1 parent 0b713f2 commit 0eab203
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ Artan requires Scala 2.12, Spark 3.0+ and Python 3,6+
This project has been published to the Maven Central Repository. When submitting jobs on your cluster, you can use
`spark-submit` with `--packages` parameter to download all required dependencies including python packages.

spark-submit --packages='com.github.ozancicek:artan_2.12:0.4.2'
spark-submit --packages='com.github.ozancicek:artan_2.12:0.5.0'

For SBT:

libraryDependencies += "com.github.ozancicek" %% "artan" % "0.4.2"
libraryDependencies += "com.github.ozancicek" %% "artan" % "0.5.0"

For python:

pip install artan

Note that pip will only install the python dependencies. To submit pyspark jobs, `--packages='com.github.ozancicek:artan_2.12:0.4.2'` argument should be specified in order to download necessary jars.
Note that pip will only install the python dependencies. To submit pyspark jobs, `--packages='com.github.ozancicek:artan_2.12:0.5.0'` argument should be specified in order to download necessary jars.


## Docs and Examples
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ val longDesc = """Online latent state estimation with Apache Spark.

lazy val settings = Seq(
scalaVersion := scalaVer,
version := "0.4.2",
version := "0.5.0",
organization := "com.github.ozancicek",
organizationName := "ozancicek",
sparkVersion := sparkVer,
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'Ozan Cicekci'

# The full version, including alpha/beta/rc tags
release = '0.4.2'
release = '0.5.0'
rst_epilog = f"""
.. |artan_version| replace:: {release}
"""
Expand Down
3 changes: 2 additions & 1 deletion docs/gmmguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ consecutive numbers with timestamps. These consecutive numbers are binned to sim
// Set initial values and hyperparams.
val gmm = new MultivariateGaussianMixture()
.setMixtureCount(3)
.setInitialWeights(Array(0.33, 0.33, 0.33))
.setStateKeyCol("stateKey")
.setInitialMeans(Array(Array(3.0, 5.0), Array(6.0, 6.0), Array(7.0, 1.0)))
Expand Down Expand Up @@ -207,7 +208,7 @@ consecutive numbers with timestamps. These consecutive numbers are binned to sim
eye = [1.0, 0.0, 0.0, 1.0]
gmm = MultivariateGaussianMixture()\
.setMixtureCount(3)\
.setInitialWeights([0.0, 0.0, 0.0])\
.setInitialWeights([0.33, 0.33, 0.33])\
.setStateKeyCol("stateKey")\
.setInitialMeans([[3.0, 5.0], [6.0, 6.0], [7.0, 1.0]])\
.setInitialCovariances([eye, eye, eye])\
Expand Down
2 changes: 2 additions & 0 deletions docs/rlsguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ identifying different models and their incremented index.
val filter = new RecursiveLeastSquaresFilter()
.setStateKeyCol("stateKey")
.setFeatureSize(3)
.setInitialEstimate(new DenseVector(Array(0.0, 0.0, 0.0)))
.setRegularizationMatrixFactor(10E6)
.setForgettingFactor(0.99)
Expand Down Expand Up @@ -185,6 +186,7 @@ identifying different models and their incremented index.
rls = RecursiveLeastSquaresFilter()\
.setStateKeyCol("stateKey")\
.setFeatureSize(3)\
.setInitialEstimate(Vectors.dense([0.0, 0.0, 0.0]))\
.setRegularizationMatrixFactor(10E6)\
.setForgettingFactor(0.99)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/python/streaming/gmm_rate_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
initial_covs = [eye, eye, eye]
gmm = MultivariateGaussianMixture()\
.setMixtureCount(3)\
.setInitialWeights([0.0, 0.0, 0.0])\
.setInitialWeights([0.33, 0.33, 0.33])\
.setStateKeyCol("stateKey")\
.setInitialMeans(initial_means)\
.setInitialCovariances(initial_covs)\
Expand Down
1 change: 1 addition & 0 deletions examples/src/main/python/streaming/rls_rate_source_ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@

rls = RecursiveLeastSquaresFilter()\
.setStateKeyCol("stateKey")\
.setFeatureSize(3)\
.setInitialEstimate(Vectors.dense([0.0, 0.0, 0.0]))\
.setRegularizationMatrixFactor(10E6)\
.setForgettingFactor(0.99)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ object GMMRateSource {
val mixture = when(weight < 0.2, dist1).when(weight < 0.5, dist2).otherwise(dist3)

val gmm = new MultivariateGaussianMixture()
.setMixtureCount(3)
.setInitialWeights(Array(0.33, 0.33, 0.33))
.setStateKeyCol("stateKey")
.setInitialMeans(Array(Array(3.0, 5.0), Array(6.0, 6.0), Array(7.0, 1.0)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ object RLSRateSourceOLS {

val filter = new RecursiveLeastSquaresFilter()
.setStateKeyCol("stateKey")
.setFeatureSize(3)
.setInitialEstimate(new DenseVector(Array(0.0, 0.0, 0.0)))
.setRegularizationMatrixFactor(10E6)
.setForgettingFactor(0.99)
Expand Down
9 changes: 9 additions & 0 deletions python/artan/mixture/mixture_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,15 @@ class MixtureParams(HasSampleCol, HasStepSize, HasStepSizeCol, HasInitialWeights
HasMinibatchSizeCol, HasUpdateHoldoutCol, HasBatchTrainEnabled, HasBatchTrainMaxIter,
HasBatchTrainTol, HasMixtureCount):

def setMixtureCount(self, value):
"""
Sets the number of components in the finite mixture
:param value: Int
:return: MixtureTransformer
"""
return self._set(mixtureCount=value)

def setSampleCol(self, value):
"""
Sets the sample column for the mixture model inputs. Depending on the mixture distribution, sample type should
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from setuptools import setup


VERSION = "0.4.2"
VERSION = "0.5.0"

with open("README.md") as f:
long_description = f.read()
Expand Down

0 comments on commit 0eab203

Please sign in to comment.