(->clojure value)Converts a value that Spark hands back, such as a Row, a Scala collection or
an MLlib vector, into Clojure data. A Clojure map, vector or set keeps its
type, with its contents converted, and a Boolean comes back as true or
false itself, which a Boolean that Java deserialised isn't.
Converts a value that Spark hands back, such as a Row, a Scala collection or an MLlib vector, into Clojure data. A Clojure map, vector or set keeps its type, with its contents converted, and a Boolean comes back as `true` or `false` itself, which a Boolean that Java deserialised isn't.
(->java cls value)Converts a Clojure value into an argument for a Java setter that takes
cls: numbers to the right width, collections to arrays, strings to enums.
Converts a Clojure value into an argument for a Java setter that takes `cls`: numbers to the right width, collections to arrays, strings to enums.
(->java-array coll)A Java array of the collection's values, which Spark's lit takes as an
array literal: keywords become their names, nils stay, a nested collection
becomes a nested array, and numbers widen as Clojure's arithmetic widens
them, at any depth: to doubles with a double among them, to BigDecimals
with a BigDecimal or a ratio, and otherwise to longs. A decimal that
Spark's DECIMAL(38,18) for such an array can't hold exactly throws, and so
does a collection that's empty or all nils, one that holds maps, and one
whose values have different types, since Spark can't type its array.
A Java array of the collection's values, which Spark's `lit` takes as an array literal: keywords become their names, nils stay, a nested collection becomes a nested array, and numbers widen as Clojure's arithmetic widens them, at any depth: to doubles with a double among them, to BigDecimals with a BigDecimal or a ratio, and otherwise to longs. A decimal that Spark's DECIMAL(38,18) for such an array can't hold exactly throws, and so does a collection that's empty or all nils, one that holds maps, and one whose values have different types, since Spark can't type its array.
(->scala-list-map pairs)An immutable Scala ListMap of the key-value pairs, which keeps their order, on Scala 2.12 and 2.13.
An immutable Scala ListMap of the key-value pairs, which keeps their order, on Scala 2.12 and 2.13.
(->scala-seq coll)An immutable Scala List, which Spark's methods take as a Seq on both Scala 2.12 and 2.13.
An immutable Scala List, which Spark's methods take as a Seq on both Scala 2.12 and 2.13.
(dense & values)Params: (firstValue: Double, otherValues: Double*)
Result: Vector
Creates a dense vector from its values.
Source: https://spark.apache.org/docs/3.0.1/api/scala/org/apache/spark/ml/linalg/Vectors$.html
Timestamp: 2020-10-19T01:56:35.334Z
Params: (firstValue: Double, otherValues: Double*) Result: Vector Creates a dense vector from its values. Source: https://spark.apache.org/docs/3.0.1/api/scala/org/apache/spark/ml/linalg/Vectors$.html Timestamp: 2020-10-19T01:56:35.334Z
(instantiate cls params)(instantiate cls defaults params)Creates an instance of cls, and sets params and defaults on it, as
set-params! does.
Creates an instance of `cls`, and sets `params` and `defaults` on it, as `set-params!` does.
(mllib-class class-name)One of MLlib's classes, such as org.apache.spark.ml.linalg.DenseVector.
They come with spark-mllib, which is classic Spark only, so a Spark Connect
client doesn't have them, and Geni looks them up when it needs them.
One of MLlib's classes, such as `org.apache.spark.ml.linalg.DenseVector`. They come with spark-mllib, which is classic Spark only, so a Spark Connect client doesn't have them, and Geni looks them up when it needs them.
(read-json json-str)Parses a JSON string into Clojure data, with keywords for the keys.
Parses a JSON string into Clojure data, with keywords for the keys.
(row & values)Params: (values: Seq[Any])
Result: Row
Source: https://spark.apache.org/docs/3.0.1/api/scala/org/apache/spark/sql/Row$.html
Timestamp: 2020-10-19T01:56:24.277Z
Params: (values: Seq[Any]) Result: Row Source: https://spark.apache.org/docs/3.0.1/api/scala/org/apache/spark/sql/Row$.html Timestamp: 2020-10-19T01:56:24.277Z
(set-params! instance params)(set-params! instance defaults params)Sets params on instance through its setters (e.g. {:input-col "text"} through setInputCol), and returns the instance. A key in
params that has no setter throws, with the class's params in the message.
The keys in defaults, which are Geni's own, are set when the class has a
setter for them and skipped when it doesn't, since a default can be missing
from one Spark version.
Sets `params` on `instance` through its setters (e.g. `{:input-col
"text"}` through `setInputCol`), and returns the instance. A key in
`params` that has no setter throws, with the class's params in the message.
The keys in `defaults`, which are Geni's own, are set when the class has a
setter for them and skipped when it doesn't, since a default can be missing
from one Spark version.(setters-map cls)The class's setters by param keyword, each a vector of the methods of that name, which can be overloads.
The class's setters by param keyword, each a vector of the methods of that name, which can be overloads.
Params: (size: Int, indices: Array[Int], values: Array[Double])
Result: Vector
Creates a sparse vector providing its index array and value array.
vector size.
index array, must be strictly increasing.
value array, must have the same length as indices.
Source: https://spark.apache.org/docs/3.0.1/api/scala/org/apache/spark/ml/linalg/Vectors$.html
Timestamp: 2020-10-19T01:56:35.350Z
Params: (size: Int, indices: Array[Int], values: Array[Double]) Result: Vector Creates a sparse vector providing its index array and value array. vector size. index array, must be strictly increasing. value array, must have the same length as indices. Source: https://spark.apache.org/docs/3.0.1/api/scala/org/apache/spark/ml/linalg/Vectors$.html Timestamp: 2020-10-19T01:56:35.350Z
(vector->seq spark-vector)An MLlib vector's values, every one of them, a sparse vector's zeros too.
An MLlib vector's values, every one of them, a sparse vector's zeros too.
(write-json x)Writes Clojure data as a JSON string, with keywords as strings.
Writes Clojure data as a JSON string, with keywords as strings.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |