Giter Site home page Giter Site logo

scalaml's Introduction

Scala for Machine Learning Version 0.99.1
Copyright Patrick Nicolas All rights reserved 2013-2016
=================================================================

Overview
Latest release
Documentation
Minimum requirements
History
Project
installation
build
Run examples
Persistent models and configurations
Appendix

Overview

The source code provides software developers with a broad overview of the difference in machine learning algorithms. The reader is expected to have a good grasp of the Scala programming language along with some knowledge in basic statistics. Experience in data mining and machine learning is not a pre-requisite.

Source code guidelines are defined in the companion document SourceCodeGuide.html

The examples are related to investment portfolio management and trading strategies. For the readers interested either in mathematics or the techniques implemented in this library, I strongly recommend the following readings:

  • "Machine Learning: A Probabilistic Perspective" K. Murphy - MIT Press - 2012
  • "The Elements of Statistical Learning" T. Hastie, R. Tibshirani, J. Friedman - Springer - 2001
  • "Pattern Recognition and Machine Learning" C. Bishop - Springer 2006
The real-world examples, related to financial and market analysis, used for the sole purpose of illustrating the machine learning techniques. They do not constitute a recommendation or endorsement of any specific investment management or trading techniques.
The Appendix contains an introduction to the basic concepts of investment and trading strategies as well as technical analysis of financial markets.

Latest release

Here is the list of changes introduced in version 0.99.1 of "Scala for Machine Learning"
  • Add description of some algorithms in Scaladoc class header
  • Resolve issues with shadowing types and variables
  • Rename some file names to match class names (SingleLinearRegressionEval, NaiveBayesLikelihood, TensorFunctor...)

Note: The implementation of Cholesky decomposition for the adjustment (or correction) of the state x of the Kalman filter using the measured value (z may throw an NonSymmetricMatrixException depending on the input value. The problem is caused by the default values used to validate that the matrix is indeed symmetric.
The problem is fixed in version 3.6:
"A call to "KalmanFilter#correct(...)" may have resulted in "NonSymmetricMatrixException" as the internally used matrix inversion method was using a too strict symmetry check. Fixes MATH-1062."

Documentation

The best approach to learn about any particular learning algorithm is to
  • Read the appropriate chapter (i.e. Chapter 5: Naive Bayes modelsM)
  • Review source code guidelines used in the book SourceCodeGuide.html
  • Review scaladoc in scala_2.11-0.99-sources.jar or scala_2.10-0.99-sources.jar depending on the version of Scala you are using.
  • Look at the examples related to the chapter (i.e. org/scalaml/app/chap5/Chap5)
  • Browse through the implementation code (i.e. org/scalaml/supervised/bayes)

Minimum Requirements

Hardware: 2 CPU core with 4 Gbytes RAM for small datasets to build and run examples.
4 CPU Core and 8+ Gbytes RAM for datasets of size 75,000 or larger and/or with 50 features set or larger
Operating system: None
Software: JDK 1.7.0_45 or 1.8.0_25, Scala 2.10.4 (for Apache Spark) or 2.11.2 (for Akka) and SBT 0.13+ (see installation section for deployment.

History

0.99.1 (12/17/2015)

See Latest release

0.99 (10/30/2015)

  • Broader uses of higher order method such as aggregate, collect, partition, groupBy ...
  • Strict monadic encoding of data transformation from an explicit model, and data transformation from a model derived from a training set.
  • Correction and update of documentation for some statistical formulas.
  • Reimplementation of training of logistic regression, Q-Learning and hidden Markov and execution of genetic algorithm using tail recursion
  • Implementation of magnet pattern for overloaded methods with different return types
  • Definition of covariant and contravariant functors
  • Fix bugs in training of Multilayer perceptron
  • Generic monitoring class for profiling execution of optimizers
  • Introduction of monadic kernel functions with a test case
  • Introduction to manifolds
  • Introduction to Convolution Neural Networks
  • Fisher-Yates shuffle for stochastic and batched gradient descent
  • Implementation of 1-fold and K-fold cross-validation
  • Standardization of the application of tail recursion for dynamic programming algorithms
  • Uses of views to reduce uncessary generation of intermediate objects in processing pipeline
  • Introduction to streams in Chapter 12 with example and test code
  • Stricter adherence to coding convention for implicits, traits, abstract classes
  • Improved scaladoc documentation
  • Added support for Scala 2.11.2, Akka 2.3.4 and Apache Spark 1.5.0 (with Scala 2.10.4)

0.98.2 (03/19/2015)

  • Fixes bugs with SVR and hidden Markov model - Decoding
  • Expand the number of test/evaluations from 60 to 66

0.98.1 (02/14/2015)

  • Added function minimization as a test case for Genetic algorithms
  • Added monitoring callback for reproduction cycle of the genetic algorithm and update implementation of trading signals
  • Standardized string representation of collection using mkString
  • Added plots to the performance benchmark of parallel collection (Chap. 12)
  • Simplified and re-implemented the Viterbi algorithm (HMM - decoding) as a tail recursion and normalize lambda probabilities matrices
  • Expanded scaladocs with reference to the chapters of "Scala for Machine Learning"
  • Replace some enumeration by case classes
  • Added scalastyle options

0.98 (12/02/2014)

  • Added comments to test cases
  • Add
  • ed Scala source guide
  • Wrapped Scalatest routines into futures
  • Expand the number of test/evaluations from 39 to 60

0.97 (06/12/2014)

Initial implementation

Project Components

Directory structure of the source code library for Scala for Machine Learning:

Source code



Directory structure of the source code of the examples for Scala for Machine Learning:

Examples



Installation and Build

Installation

The installation and build workflow is described in the following diagram:

Installation and build


Eclipse The Scala for Machine Learning library is compatible with Eclipse Scala IDE 3.0
Specify link to the source in Project/properties/Java Build Path/Source. The two links should be project_name/src/main/scala and project_name/src/test/scala
Add the jars required to build and execute the code within Eclipse Project/properties/Java Build Path/Add External Jarsas declared in the project_name/.classpath
Update the JVM heap parameters in eclipse.ini file as -Xms512m -Xmx8192m or the maximum allowed on your specific machine.

Build

build.sbt

The Simple Build Too (SBT) has to be used to build the library from the source code using the build.sbt file in the root directory
Executing the examples/test in Scala for Machine Learning require sufficient JVM Heap memory (~2G):
in sbt/conf/sbtconfig.text set Xmx to 2058m or higher, -XX:MaxPermSize to 512m or higher i.e. -Xmx4096m -Xms512m -XX:MaxPermSize=512m

Build script for Scala for Machine Learning:
To build the Scala for Machine Learning library package
$(ROOT)/sbt clean publish-local
To build the package including test and resource files
$(ROOT)/sbt clean package
To generate scala doc for the library
$(ROOT)/sbt doc
To generate scala doc for the examples
$(ROOT)/sbt test:doc
To generate report for compliance to Scala style guide:
$(ROOT)/sbt scalastyle
To compile all examples:
$(ROOT)/sbt test:compile

Maven

A simple pom.xml is available to build the library and execute the test cases:
$(ROOT)/mvn compile to compile the library
$(ROOT)/mvn test to compile and run the examples

Run examples

Note: As the implementation evolves over-time, few test examples may differ from the original test described in the book. The implementation of the algorithm is not expected to change.

Examples in a chapter

To run the examples of a particular chapter (i.e. Chapter 4)
$(ROOT)/$sbt
>test-only org.scalaml.app.chap4.Chap4

All examples

To run all examples with output configuration:
$(ROOT)/sbt "test:run options" where options is a list of possible outputs
  • console to output results onto standard output
  • logger to output results into a log file (log4j)
  • chart to plot results using jFreeChart
$(ROOT)/sbt "test:run log chart" write test results into a log and charts
$(ROOT)/sbt test:run write test results into the standard output and the charts.
$(ROOT)/mvn test to compile and run the examples

Persistent models and configurations

The package object org.scalaml.core.Design provide the trait (or skeleton implementation) of the persistent model Design.Model and configuration Design.Config.
The persistency mechanisms is implemented for a couple of supervised learning models only for illustration purpose. The reader should be able to implement the persistency for configuration and models for all relevant learning algorithms using the template operator << and >>

Appendix

The examples have been built and tested with the following libraries:
Java libraries
CRF-Trove_3.0.2.jar
LBFGS.jar
colt.jar
CRF-1.1.jar
commons-math3-3.5.jar
libsvm_sml-3.18.jar
jfreechart-1.0.17/lib/jcommon-1.0.21.jar
jfreechart-1.0.17/lib/servlets.jar
junit-4.11.jar
jfreechart-1.0.17/lib/jfreechart-1.0.17.jar
Scala 2.10 related libraries
com.typesafe/config/1.2.1/bundles/config.jar
akka-actor_2.10-2.2.3.jar
scalatest_2.1.16.jar
spark-assembly-1.5.0-hadoop2.4.0.jar
Scala 2.11. related libraries
com.typesafe/config/1.2.2/bundles/config.jar
scalatest_2.2.2.jar
akka-actor_2.11-2.3.4.jar
spark-assembly-1.5.0-hadoop2.4.0.jar

scalaml's People

Contributors

prnicolas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scalaml's Issues

Problems running examples with sbt - Viterbi failed class

Hi I'm trying to run the examples, but when I ran this command

set build.sbt

or

sbt clean publish-local

I have this error:

image

The full error stack is this:

[info] Loading project definition from /Users/jguzman/Desktop/scalaML2/project
[info] Set current project to ScalaMl (in build file:/Users/jguzman/Desktop/scalaML2/)
[success] Total time: 0 s, completed 27-05-2016 20:48:07
[info] Updating {file:/Users/jguzman/Desktop/scalaML2/}scalaml2...
[info] Packaging /Users/jguzman/Desktop/scalaML2/target/scala-2.11/scalaml_2.11-0.99-sources.jar ...
[info] Wrote /Users/jguzman/Desktop/scalaML2/target/scala-2.11/scalaml_2.11-0.99.pom
[info] Resolving org.scala-lang#scala-library;2.11.2 ...
[info] Done packaging.
[info] Resolving jline#jline;2.12 ...
[info] Done updating.
[warn] Scala version was updated by one of library dependencies:
[warn]  * org.scala-lang:scala-library:(2.11.2, 2.11.4, 2.11.0, 2.11.5, 2.11.1) -> 2.11.7
[warn] To force scalaVersion, add the following:
[warn]  ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
[warn] Run 'evicted' to see detailed eviction warnings
[info] :: delivering :: Patrick Nicolas#scalaml_2.11;0.99 :: 0.99 :: release :: Fri May 27 20:48:10 CLT 2016
[info]  delivering ivy file to /Users/jguzman/Desktop/scalaML2/target/scala-2.11/ivy-0.99.xml
[info] Compiling 165 Scala sources to /Users/jguzman/Desktop/scalaML2/target/scala-2.11/classes...
[info] Main Scala API documentation to /Users/jguzman/Desktop/scalaML2/target/scala-2.11/api...
model contains 387 documentable templates
[warn] there was one deprecation warning; re-run with -deprecation for details
[warn] there were four inliner warnings; re-run with -Yinline-warnings for details
[warn] two warnings found
[info] Packaging /Users/jguzman/Desktop/scalaML2/target/scala-2.11/scalaml_2.11-0.99.jar ...
[info] Done packaging.
java.lang.AssertionError: assertion failed: class Viterbi: <none>
    at scala.tools.nsc.symtab.classfile.ClassfileParser.parseMethod(ClassfileParser.scala:575)
    at scala.tools.nsc.symtab.classfile.ClassfileParser.scala$tools$nsc$symtab$classfile$ClassfileParser$$queueLoad$1(ClassfileParser.scala:478)
    at scala.tools.nsc.symtab.classfile.ClassfileParser$$anonfun$parseClass$1.apply$mcV$sp(ClassfileParser.scala:488)
    at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:493)
    at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:134)
    at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:293)
    at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:211)
    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1429)
    at scala.tools.nsc.doc.base.MemberLookupBase$$anonfun$cleanupBogusClasses$1$1.apply(MemberLookupBase.scala:149)
    at scala.tools.nsc.doc.base.MemberLookupBase$$anonfun$cleanupBogusClasses$1$1.apply(MemberLookupBase.scala:149)
    at scala.collection.TraversableLike$$anonfun$filterImpl$1.apply(TraversableLike.scala:259)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.TraversableLike$class.filterImpl(TraversableLike.scala:258)
    at scala.collection.TraversableLike$class.filter(TraversableLike.scala:270)
    at scala.collection.AbstractTraversable.filter(Traversable.scala:104)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.cleanupBogusClasses$1(MemberLookupBase.scala:149)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.lookupInTemplate(MemberLookupBase.scala:160)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.scala$tools$nsc$doc$base$MemberLookupBase$$lookupInTemplate(MemberLookupBase.scala:124)
    at scala.tools.nsc.doc.base.MemberLookupBase$$anonfun$completeSearch$1$1.apply(MemberLookupBase.scala:131)
    at scala.tools.nsc.doc.base.MemberLookupBase$$anonfun$completeSearch$1$1.apply(MemberLookupBase.scala:131)
    at scala.collection.immutable.List.flatMap(List.scala:327)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.completeSearch$1(MemberLookupBase.scala:131)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.scala$tools$nsc$doc$base$MemberLookupBase$$lookupInTemplate(MemberLookupBase.scala:133)
    at scala.tools.nsc.doc.base.MemberLookupBase$$anonfun$completeSearch$1$1.apply(MemberLookupBase.scala:131)
    at scala.tools.nsc.doc.base.MemberLookupBase$$anonfun$completeSearch$1$1.apply(MemberLookupBase.scala:131)
    at scala.collection.immutable.List.flatMap(List.scala:327)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.completeSearch$1(MemberLookupBase.scala:131)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.scala$tools$nsc$doc$base$MemberLookupBase$$lookupInTemplate(MemberLookupBase.scala:133)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.lookupInRootPackage(MemberLookupBase.scala:111)
    at scala.tools.nsc.doc.base.MemberLookupBase$class.memberLookup(MemberLookupBase.scala:52)
    at scala.tools.nsc.doc.DocFactory$$anon$1.memberLookup(DocFactory.scala:68)
    at scala.tools.nsc.doc.base.MemberLookupBase$$anon$1.link$lzycompute(MemberLookupBase.scala:27)
    at scala.tools.nsc.doc.base.MemberLookupBase$$anon$1.link(MemberLookupBase.scala:27)
    at scala.tools.nsc.doc.base.comment.EntityLink$.unapply(Body.scala:73)
    at scala.tools.nsc.doc.html.HtmlPage.inlineToHtml(HtmlPage.scala:125)
    at scala.tools.nsc.doc.html.HtmlPage$$anonfun$inlineToHtml$1.apply(HtmlPage.scala:114)
    at scala.tools.nsc.doc.html.HtmlPage$$anonfun$inlineToHtml$1.apply(HtmlPage.scala:114)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:252)
    at scala.collection.immutable.List.flatMap(List.scala:344)
    at scala.tools.nsc.doc.html.HtmlPage.inlineToHtml(HtmlPage.scala:114)
    at scala.tools.nsc.doc.html.HtmlPage$$anonfun$inlineToHtml$1.apply(HtmlPage.scala:114)
    at scala.tools.nsc.doc.html.HtmlPage$$anonfun$inlineToHtml$1.apply(HtmlPage.scala:114)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:252)
    at scala.collection.immutable.List.flatMap(List.scala:344)
    at scala.tools.nsc.doc.html.HtmlPage.inlineToHtml(HtmlPage.scala:114)
    at scala.tools.nsc.doc.html.HtmlPage.blockToHtml(HtmlPage.scala:88)
    at scala.tools.nsc.doc.html.HtmlPage$$anonfun$bodyToHtml$1.apply(HtmlPage.scala:81)
    at scala.tools.nsc.doc.html.HtmlPage$$anonfun$bodyToHtml$1.apply(HtmlPage.scala:81)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:252)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:252)
    at scala.collection.immutable.List.flatMap(List.scala:344)
    at scala.tools.nsc.doc.html.HtmlPage.bodyToHtml(HtmlPage.scala:81)
    at scala.tools.nsc.doc.html.HtmlPage.commentToHtml(HtmlPage.scala:78)
    at scala.tools.nsc.doc.html.HtmlPage.commentToHtml(HtmlPage.scala:74)
    at scala.tools.nsc.doc.html.page.Template.memberToCommentBodyHtml(Template.scala:349)
    at scala.tools.nsc.doc.html.page.Template.memberToCommentHtml(Template.scala:311)
    at scala.tools.nsc.doc.html.page.Template.memberToHtml(Template.scala:290)
    at scala.tools.nsc.doc.html.page.Template$$anonfun$11.apply(Template.scala:199)
    at scala.tools.nsc.doc.html.page.Template$$anonfun$11.apply(Template.scala:199)
    at scala.collection.immutable.List.map(List.scala:272)
    at scala.tools.nsc.doc.html.page.Template.<init>(Template.scala:199)
    at scala.tools.nsc.doc.html.HtmlFactory.scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1(HtmlFactory.scala:146)
    at scala.tools.nsc.doc.html.HtmlFactory$$anonfun$scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1$2.apply(HtmlFactory.scala:148)
    at scala.tools.nsc.doc.html.HtmlFactory$$anonfun$scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1$2.apply(HtmlFactory.scala:148)
    at scala.collection.immutable.List.map(List.scala:276)
    at scala.tools.nsc.doc.html.HtmlFactory.scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1(HtmlFactory.scala:148)
    at scala.tools.nsc.doc.html.HtmlFactory$$anonfun$scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1$2.apply(HtmlFactory.scala:148)
    at scala.tools.nsc.doc.html.HtmlFactory$$anonfun$scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1$2.apply(HtmlFactory.scala:148)
    at scala.collection.immutable.List.map(List.scala:276)
    at scala.tools.nsc.doc.html.HtmlFactory.scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1(HtmlFactory.scala:148)
    at scala.tools.nsc.doc.html.HtmlFactory$$anonfun$scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1$2.apply(HtmlFactory.scala:148)
    at scala.tools.nsc.doc.html.HtmlFactory$$anonfun$scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1$2.apply(HtmlFactory.scala:148)
    at scala.collection.immutable.List.map(List.scala:272)
    at scala.tools.nsc.doc.html.HtmlFactory.scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1(HtmlFactory.scala:148)
    at scala.tools.nsc.doc.html.HtmlFactory$$anonfun$scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1$2.apply(HtmlFactory.scala:148)
    at scala.tools.nsc.doc.html.HtmlFactory$$anonfun$scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1$2.apply(HtmlFactory.scala:148)
    at scala.collection.immutable.List.map(List.scala:272)
    at scala.tools.nsc.doc.html.HtmlFactory.scala$tools$nsc$doc$html$HtmlFactory$$writeTemplate$1(HtmlFactory.scala:148)
    at scala.tools.nsc.doc.html.HtmlFactory.writeTemplates(HtmlFactory.scala:152)
    at scala.tools.nsc.doc.html.HtmlFactory.generate(HtmlFactory.scala:131)
    at scala.tools.nsc.doc.html.Doclet.generateImpl(Doclet.scala:16)
    at scala.tools.nsc.doc.doclet.Generator.generate(Generator.scala:24)
    at scala.tools.nsc.doc.DocFactory.generate$1(DocFactory.scala:121)
    at scala.tools.nsc.doc.DocFactory.document(DocFactory.scala:124)
    at xsbt.Runner.run(ScaladocInterface.scala:26)
    at xsbt.ScaladocInterface.run(ScaladocInterface.scala:10)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
    at sbt.compiler.AnalyzingCompiler.doc(AnalyzingCompiler.scala:67)
    at sbt.compiler.AnalyzingCompiler.doc(AnalyzingCompiler.scala:62)
    at sbt.Doc$$anonfun$scaladoc$1.apply(Doc.scala:23)
    at sbt.Doc$$anonfun$scaladoc$1.apply(Doc.scala:23)
    at sbt.RawCompileLike$$anonfun$prepare$1.apply(RawCompileLike.scala:64)
    at sbt.RawCompileLike$$anonfun$prepare$1.apply(RawCompileLike.scala:56)
    at sbt.RawCompileLike$$anonfun$cached$1$$anonfun$2$$anonfun$apply$1.apply(RawCompileLike.scala:49)
    at sbt.RawCompileLike$$anonfun$cached$1$$anonfun$2$$anonfun$apply$1.apply(RawCompileLike.scala:47)
    at sbt.Tracked$$anonfun$outputChanged$1.apply(Tracked.scala:84)
    at sbt.Tracked$$anonfun$outputChanged$1.apply(Tracked.scala:79)
    at sbt.RawCompileLike$$anonfun$cached$1.apply(RawCompileLike.scala:54)
    at sbt.RawCompileLike$$anonfun$cached$1.apply(RawCompileLike.scala:39)
    at sbt.Defaults$$anonfun$docTaskSettings$3.apply(Defaults.scala:772)
    at sbt.Defaults$$anonfun$docTaskSettings$3.apply(Defaults.scala:750)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (compile:doc) java.lang.AssertionError: assertion failed: class Viterbi: <none>
[error] Total time: 29 s, completed 27-05-2016 20:48:36

What can I do ? , or any advice for solve this

chap1 tests timing out instantly, even though timeout set to 5s

chap1 tests currently exit immediately, ie:

:~/learn/ScalaMl$ sbt "test-only org.scalaml.app.chap1.Chap1"
[info] Loading project definition from /home/cody/learn/ScalaMl/project
[info] Set current project to ScalaMl (in build file:/home/cody/learn/ScalaMl/)
Maximum execution time: 5000
Maximum execution time: 5000
LogBinRegressionEval2 

 *****  test#2 LogBinRegressionEval2 binomial logistic regression test
LogBinRegressionEval 

 *****  test#2 LogBinRegressionEval binomial logistic regression
Maximum execution time: 5000
PlotterEval 

 *****  test#3 PlotterEval Evaluation of interface to JFreeChart library
Maximum execution time: 5000
ETransformEval 

 *****  test#4 ETransformEval Evaluation eTransform monad
[info] Chap1:
[info] - Chapter 1 Simple binomial logistic regression *** FAILED *** (40 milliseconds)
[info]   A timeout occurred waiting for a future to complete. Queried 1 times, sleeping 1000 milliseconds between each query. (ScalaMlTest.scala:59)
[info]   org.scalatest.concurrent.Futures$FutureConcept$$anon$1:
[info]   ...
[info]   at org.scalaml.app.ScalaMlTest$class.evaluate(ScalaMlTest.scala:59)
[info]   at org.scalaml.app.chap1.Chap1.evaluate(Chap1.scala:34)
[info]   at org.scalaml.app.chap1.Chap1$$anonfun$1.apply(Chap1.scala:43)
[info]   at org.scalaml.app.chap1.Chap1$$anonfun$1.apply(Chap1.scala:43)
[info]   at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
[info]   at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
[info]   at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info]   ...
[info] - Chapter 1 Simple binomial logistic regression validation *** FAILED *** (2 milliseconds)
[info]   A timeout occurred waiting for a future to complete. Queried 1 times, sleeping 1000 milliseconds between each query. (ScalaMlTest.scala:59)
[info]   org.scalatest.concurrent.Futures$FutureConcept$$anon$1:
[info]   ...
[info]   at org.scalaml.app.ScalaMlTest$class.evaluate(ScalaMlTest.scala:59)
[info]   at org.scalaml.app.chap1.Chap1.evaluate(Chap1.scala:34)
[info]   at org.scalaml.app.chap1.Chap1$$anonfun$2.apply(Chap1.scala:47)
[info]   at org.scalaml.app.chap1.Chap1$$anonfun$2.apply(Chap1.scala:47)
[info]   at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
[info]   at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
[info]   at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info]   ...
[info] - Chapter 1 JFreeChart Plots *** FAILED *** (2 milliseconds)
[info]   A timeout occurred waiting for a future to complete. Queried 1 times, sleeping 1000 milliseconds between each query. (ScalaMlTest.scala:59)
[info]   org.scalatest.concurrent.Futures$FutureConcept$$anon$1:
[info]   ...
[info]   at org.scalaml.app.ScalaMlTest$class.evaluate(ScalaMlTest.scala:59)
[info]   at org.scalaml.app.chap1.Chap1.evaluate(Chap1.scala:34)
[info]   at org.scalaml.app.chap1.Chap1$$anonfun$3.apply(Chap1.scala:51)
[info]   at org.scalaml.app.chap1.Chap1$$anonfun$3.apply(Chap1.scala:51)
[info]   at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
[info]   at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
[info]   at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info]   ...
[info] - Chapter 1 Min-Max *** FAILED *** (9 milliseconds)
[info]   A timeout occurred waiting for a future to complete. Queried 1 times, sleeping 1000 milliseconds between each query. (ScalaMlTest.scala:59)
[info]   org.scalatest.concurrent.Futures$FutureConcept$$anon$1:
[info]   ...
[info]   at org.scalaml.app.ScalaMlTest$class.evaluate(ScalaMlTest.scala:59)
[info]   at org.scalaml.app.chap1.Chap1.evaluate(Chap1.scala:34)
[info]   at org.scalaml.app.chap1.Chap1$$anonfun$4.apply(Chap1.scala:55)
[info]   at org.scalaml.app.chap1.Chap1$$anonfun$4.apply(Chap1.scala:55)
[info]   at org.scalatest.Transformer$$anonfun$apply$1.apply$mcV$sp(Transformer.scala:22)
[info]   at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
[info]   at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info]   ...
ETransformEval Normalized data 0.3691275167785235,0.6575342465753424,0.5240328253223915
ETransformEval Normalized data 0.0,0.9999999999999999,0.7584994138335286
ETransformEval Normalized data 0.2348993288590604,0.0,1.0
ETransformEval Normalized data 1.0,0.6061643835616438,0.0
ETransformEval Completed
PlotterEval Line plot for CSCO stock normalized volume
[info] Run completed in 344 milliseconds.
[info] Total number of tests run: 4
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 0, failed 4, canceled 0, ignored 0, pending 0
[info] *** 4 TESTS FAILED ***
[error] Failed tests:
[error]     org.scalaml.app.chap1.Chap1
[error] (test:testOnly) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 2 s, completed Jan 8, 2016 10:03:53 PM

(note: former description was wrong, symptom was throwing me off)

resources folders output with varying case not matching tests on Linux

Probably not an issue on Windows, but on Linux the case sensitivity of the directories is not matching git clone vs. the source code, ie "chap1" vs "Chap1". Since some of the folders are listed with upper, and some in lower, the intent is not clear, but most code seems to expect lower case folder names.

HMM Decoding example

I bought the book Scala for Machine Learning. I tried to use HMM in one of my projects. There're unit tests (examples) to train and evaluate the a HMM, but there's no example of decoding. I tried to write some code to decode from a trained HMM (CF-3), but I keep getting index out of bound. I'm not sure if my setup for decoding is wrong or there's some issue with the Viterbi implementation. Could you provide an example of CF-3? Thanks.

types.scala:ScalaML.toText - dropRight(1) unwanted

Around line 102 in types.scala is an error where dropRight(1) is used, which has the effect of just dropping the last character of the string conversion of the last double value, ie:

"1.0, 2.3, 3.0".dropRight(1) = "1.0, 2.3, 3."

Sum of rows in A, B and Pi are not equal 1 in Unit tests for HMM

The unit test #2 (training) for HMM for chapter 7 outputs State Transition probs A, Emission probs B and Initial probs pi:

***** test#2 HMMEval Hidden Markov Model - Training
HMMEval (Training):
State transition probs A
0.137, 0.229, 0.495, 0.282, 0.081
0.236, 0.031, 0.756, 0.947, 0.898
0.225, 0.343, 0.567, 0.096, 0.217
1.000, 0.045, 0.640, 0.046, 0.059
0.000, 0.080, 0.715, 0.309, 0.162

Emission probs B
0.311, 0.487, 0.114, 0.127, 0.068, 0.163
0.003, 0.224, 0.000, 0.044, 1.000, 0.000
0.100, 0.375, 0.150, 0.240, 0.210, 0.196
0.086, 0.615, 0.015, 0.252, 0.282, 0.020
0.304, 0.410, 0.115, 0.182, 0.068, 0.190

Initial probs pi
1.000 0.069 0.522 0.000 0.043

My understanding is the sum of the values in each rows of these matrices need to be 1.0. But they don't seem to be in the output of test#2. Could you shed some light on that?

Thanks.

Compile errors on master

e.g unfinished code:

    trait PipeOperator[T, U] extends _FCT[T, U] {
    val 
        def |> : PartialFunction[T, U]
    }

Some of compile errors:

Error:(139, 3) illegal start of simple pattern
        def |> : PartialFunction[T, U]
        ^
Error:(140, 2) '=' expected but '}' found.
    }
    ^

Current rev102 PDF Chap1 documented results do not match current test execution

The end of Chapter 1 indicates we may expect to see a chart showing 3 different learning rates, and also that the classifications for the first two data points will be a "1" and "0", with predicted values of >~0.5 and <~0.1 respectively.

However, execution of the tests (just before today's update that appears to have broken some things), results in two classifications of "0" for those same data points, and predicted values of ~0.46 and ~0.25.

I also notice the text indicates the nIters would be output, but this is also not the case.

 *****  test#1 LogBinRegressionEval binomial logistic regression
LogBinRegressionEval weights: -0.027411339959812955,-0.5610971521322289,-1.084359693720546
input 0.008837209302325677,4.10914E7 normalized 0.06306471253904308,0.06147527493891754 class (0,0.46768060497106606)|
input 0.06949806949806936,3.618657E8 normalized 0.5171000761944574,0.6415991941274024 class (0,0.2663386306666643)
LogBinRegressionEval completed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.