Liking cljdoc? Tell your friends :D

zero-one.geni.interop


->clojureclj

(->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.
sourceraw docstring

->dense-vectorclj

(->dense-vector values)
source

->javaclj

(->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.
sourceraw docstring

->java-arrayclj

(->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.
sourceraw docstring

->java-listclj

(->java-list coll)
source

->scala-function0clj

(->scala-function0 f)
source

->scala-function1clj

(->scala-function1 f)
source

->scala-function2clj

(->scala-function2 f)
source

->scala-function3clj

(->scala-function3 f)
source

->scala-list-mapclj

(->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.
sourceraw docstring

->scala-seqclj

(->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.
sourceraw docstring

->scala-tuple2clj

(->scala-tuple2 coll)
source

->spark-rowclj

(->spark-row x)
source

->sparse-vectorclj

(->sparse-vector size indices values)
source

array?clj

(array? value)
source

convert-keywordsclj

(convert-keywords value)
source

denseclj

(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
sourceraw docstring

dense-matrix?clj

(dense-matrix? value)
source

dense-vector?clj

(dense-vector? value)
source

fields-mapclj

(fields-map cls)
source

get-fieldclj

(get-field instance field-keyword)
source

instantiateclj

(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.
sourceraw docstring

iterable?clj

(iterable? value)
source

matrix->seqsclj

(matrix->seqs matrix)
source

method-keywordclj

(method-keyword method)
source

mllib-classclj

(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.
sourceraw docstring

optional->nillableclj

(optional->nillable value)
source

read-jsonclj

(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.
sourceraw docstring

rowclj

(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
sourceraw docstring

scala-map->mapclj

(scala-map->map m)
source

scala-map?clj

(scala-map? value)
source

scala-seq->vecclj

(scala-seq->vec scala-seq)
source

scala-seq?clj

(scala-seq? value)
source

scala-tuple->vecclj

(scala-tuple->vec p)
source

scala-tuple2?clj

(scala-tuple2? value)
source

scala-tuple3?clj

(scala-tuple3? value)
source

set-params!clj

(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.
sourceraw docstring

set-valueclj

(set-value method instance value)
source

setter-typeclj

(setter-type method)
source

setter?clj

(setter? method)
source

setters-mapclj

(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.
sourceraw docstring

spark-conf->mapclj

(spark-conf->map conf)
source

spark-row->mapclj

(spark-row->map row)
source

spark-row?clj

(spark-row? value)
source

sparseclj

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
sourceraw docstring

sparse-vector->seqclj

(sparse-vector->seq spark-sparse-vector)
source

sparse-vector?clj

(sparse-vector? value)
source

vector->seqclj

(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.
sourceraw docstring

with-scala-out-strcljmacro

(with-scala-out-str & body)
source

write-jsonclj

(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.
sourceraw docstring

zero-arity?clj

(zero-arity? method)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close