haifengl / smile

Statistical Machine Intelligence & Learning Engine
https://haifengl.github.io
Other
5.99k stars 1.12k forks source link

Slight improvement for quick start guide #725

Closed Mikhail42 closed 1 year ago

Mikhail42 commented 1 year ago

Smile has very good documentation, especially scala/javadoc. But some examples in Quick Start guide and, e.g., in "Supervised learning / Classification" contains examples without specified imports: https://haifengl.github.io/quickstart.html

// from Quick Start, 1st example
val formula = "class" ~  // ~ operation in unknown, and fast search by ~ does not really help
// from Supervised learning / Classification
cv.classification(10, x, y) { case (x, y) => knn(x, y, 3) } // knn is unknown function. It will be better to provide import  smile.classification.knn

I think it will be better to provide imports in starting guides, at least in non-clear cases, because it will decrease time to use for this really great library.

Another variant is to provide links to examples (to unit tests, in our case). Any test contains fully executable code with needed context, so it is really helpful.

Mikhail42 commented 1 year ago

Maybe it is not so relevant for Scala 2, where IDE (Intellij) has better compatibility and suggests some imports (not always), but in Scala 3 it is not so easy. PS: actually in Scala 3 IDE also suggest imports sometimes.

haifengl commented 1 year ago

The examples are intended for smile shell, which imports all these already.