Packages

o

io.citrine.lolo.util

LoloPyDataLoader

object LoloPyDataLoader

Tool used to transfer data from LoloPy to the JVM

Works by receiving an byte array and converting it to Scala Sequence

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LoloPyDataLoader
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def deserializeObject(bytes: Array[Byte]): Any

    Deserialize a JVM object from a byte array

    Deserialize a JVM object from a byte array

    bytes

    Bytes to be unserialized

    returns

    The object

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. def get1DArray(input: Array[Byte], getDouble: Boolean, bigEndian: Boolean): Seq[Any]

    Receive a 1D array of floats or integers

    Receive a 1D array of floats or integers

    input

    Input byte array

    getDouble

    Whether to read doubles (or integers)

    bigEndian

    Whether the file

  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def getClassifierExpected(predictionResult: PredictionResult[Any]): Array[Byte]

    Get the predicted class from a classification model

    Get the predicted class from a classification model

    Note: The class labels must be integers

    predictionResult

    Prediction result from a classifier

    returns

    Bytes of a integer array of the predicted class labels

  13. def getClassifierProbabilities(predictionResult: PredictionResult[Any], nClasses: Int): Array[Byte]

    Get the classification probabilities as an array

    Get the classification probabilities as an array

    Note: Model must be trained with sequential nonnegative integers starting at 0 as class names.

    predictionResult

    Prediction result from a classifier

    nClasses

    Number of classes in the problem

    returns

    Bytes of a double array of probabilities, stored row-wise (i.e., first entry, then second, ...)

  14. def getFeatureArray(input: Array[Byte], numAttributes: Integer, bigEndian: Boolean): Seq[Vector[Double]]

    Receives the feature array.

    Receives the feature array. Assumes it to be in a C-ordering

    input

    Input array as a byte array

    numAttributes

    Number of features in the array

    bigEndian

    Whether the numbers are is big-endian or not

    returns

    The array as a Scala array

  15. def getImportanceScores(predictionResult: PredictionResult[Any]): Array[Byte]

    Send the training entry importance scores to the Python client

    Send the training entry importance scores to the Python client

    predictionResult

    Prediction result object

    returns

    Byte of array of doubles in native system order

  16. def getMultiRegressionExpected(predictionResult: MultiTaskModelPredictionResult): Array[Byte]

    Generate the results of a multitask regression model, which are assumed to be all doubles

    Generate the results of a multitask regression model, which are assumed to be all doubles

    predictionResult

    result of predicting on a multitask model

    returns

    Byte array of doubles in native system order (the caller must then reshape the result into a 2d array)

  17. def getMultiRegressionUncertainty(predictionResult: MultiTaskModelPredictionResult): Array[Byte]

    Get the uncertainties of a multitask regression model, which are assumed to be all doubles

    Get the uncertainties of a multitask regression model, which are assumed to be all doubles

    predictionResult

    result of predicting on a multitask model

    returns

    Byte array of doubles in native system order (the caller must then reshape the result into a 2d array)

  18. def getRegressionCorrelation(predictionResult: MultiTaskModelPredictionResult, i: Int, j: Int): Array[Byte]

    Get the correlation coefficients between the uncertainties of a multitask regression model.

    Get the correlation coefficients between the uncertainties of a multitask regression model. By calling this method for all (i, j) pairs, one can construct a correlation matrix. Combined with getMultiRegressionUncertainty, one can construct the covariance matrix.

    predictionResult

    result of predicting on a multitask model

    i

    index of the first output

    j

    index of the second output

    returns

    Byte array of doubles in native system order

  19. def getRegressionExpected(predictionResult: PredictionResult[Any]): Array[Byte]

    Generate the results of a regression model, which are assumed to be doubles

    Generate the results of a regression model, which are assumed to be doubles

    predictionResult

    Prediction result object

    returns

    Byte array of doubles in native system order

  20. def getRegressionUncertainty(predictionResult: PredictionResult[Any]): Array[Byte]

    Generate the uncertainties of a regression model, which are assumed to be doubles

    Generate the uncertainties of a regression model, which are assumed to be doubles

    predictionResult

    Prediction result object

    returns

    Byte array of doubles in native system order

  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def makeRegressionPredictionResult(expected: Seq[Double], uncertainty: Seq[Double]): PredictionResult[Double]

    Create a PredictionResult object from the mean and uncertainty

    Create a PredictionResult object from the mean and uncertainty

    expected

    Mean of the predictions of a model

    uncertainty

    Uncertainty of the predictions

    returns

    Prediction result object

  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. def send1DArray(data: Seq[Double]): Array[Byte]

    Prepare to send a 1D array of Doubles by converting it to a byte array

    Prepare to send a 1D array of Doubles by converting it to a byte array

    data

    Data to be sent

    returns

    Byte array with all the doubles in Seq ordered in system byte order

  28. def serializeObject(obj: Any, compressLevel: Int): Array[Byte]

    Convert a JVM object to a byte array

    Convert a JVM object to a byte array

    Used for saving a model in lolopy inside of a pickle file.

    obj

    Object to be saved

    compressLevel

    Compression level used to condense the serialized representation

    returns

    Object as a serialized byte array

  29. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  34. def zipTrainingData(X: Seq[Vector[Double]], y: Seq[Any]): Seq[(Vector[Double], Any)]

    Zips the features and labels together

    Zips the features and labels together

    This function was created to provide the ability to easily Zip training and testing data when using Lolo from lolopy. Py4J does not support generic methods well, and this function is a workaround for being able to call zip when needed generate a training set.

    X

    Feature array

    y

    Label array

    returns

    Zipped arrays

Inherited from AnyRef

Inherited from Any

Ungrouped