object LoloPyDataLoader
Tool used to transfer data from LoloPy to the JVM
Works by receiving an byte array and converting it to Scala Sequence
- Alphabetic
- By Inheritance
- LoloPyDataLoader
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- 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
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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
- 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, ...)
- 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
- 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
- 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)
- 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)
- 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
- 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
- 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
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- 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