Uses of Class
org.tribuo.math.la.SparseVector
Package
Description
Provides an implementation of LIME (Locally Interpretable Model Explanations).
Provides infrastructure for Stochastic Gradient Descent for classification problems.
Provides an implementation of a linear chain CRF trained using Stochastic Gradient Descent.
Provides common functionality for building decision trees, irrespective
of the predicted
Output
.Provides abstract classes for interfacing with XGBoost abstracting away all the
Output
dependent parts.This package contains the abstract implementation of an external model
trained by something outside of Tribuo.
Code for uploading models to Oracle Cloud Infrastructure Data Science, and also for scoring models deployed
in Oracle Cloud Infrastructure Data Science.
This package contains a Tribuo wrapper around the ONNX Runtime.
Provides an interface to TensorFlow, allowing the training of non-sequential models using any supported
Tribuo output type.
Provides a
Kernel
interface for Mercer kernels, along with implementations of standard kernels.Provides a linear algebra system used for numerical operations in Tribuo.
Provides math related util classes.
Provides classes and infrastructure for working with multi-label classification problems.
Provides an implementation of a multi-label classification factorization machine model using Stochastic Gradient Descent.
Provides an implementation of a multi-label classification linear model using Stochastic Gradient Descent.
Provides infrastructure for Stochastic Gradient Descent based regression models.
Provides implementations of sparse linear regression using various forms of regularisation penalty.
-
Uses of SparseVector in org.tribuo.classification.explanations.lime
Modifier and TypeMethodDescriptionstatic double
LIMEBase.measureDistance
(ImmutableFeatureMap fMap, long numTrainingExamples, SparseVector input, SparseVector sample) Measures the distance between an input point and a sampled point.LIMEBase.samplePoint
(Random rng, ImmutableFeatureMap fMap, long numTrainingExamples, SparseVector input) Samples a single example from the supplied feature map and input vector. -
Uses of SparseVector in org.tribuo.classification.sgd
Modifier and TypeFieldDescriptionfinal SparseVector[]
Util.ExampleArray.features
The examples encoded as sparse vectors.Modifier and TypeMethodDescriptionstatic Util.ExampleArray
Util.shuffle
(SparseVector[] features, int[] labels, double[] weights, SplittableRandom rng) Shuffles the features, labels and weights returning a tuple of the shuffled inputs.static void
Util.shuffleInPlace
(SparseVector[] features, int[] labels, double[] weights, int[] indices, SplittableRandom rng) In place shuffle of the features, labels, weights and indices.static void
Util.shuffleInPlace
(SparseVector[] features, int[] labels, double[] weights, SplittableRandom rng) Deprecated.ModifierConstructorDescriptionExampleArray
(SparseVector[] features, int[] labels, double[] weights) Constructs an example array. -
Uses of SparseVector in org.tribuo.classification.sgd.crf
Modifier and TypeMethodDescriptionstatic <T extends Output<T>>
SparseVector[]CRFModel.convert
(SequenceExample<T> example, ImmutableFeatureMap featureIDMap) Deprecated.As it's replaced withCRFModel.convertToVector(org.tribuo.sequence.SequenceExample<T>, org.tribuo.ImmutableFeatureMap)
which is more flexible. -
Uses of SparseVector in org.tribuo.common.tree
Modifier and TypeMethodDescriptionAbstractTrainingNode.getNextNode
(SparseVector example) LeafNode.getNextNode
(SparseVector e) Node.getNextNode
(SparseVector example) Returns the next node in the tree based on the supplied example, or null if it's a leaf.SplitNode.getNextNode
(SparseVector e) Return the appropriate child node. -
Uses of SparseVector in org.tribuo.common.xgboost
Modifier and TypeMethodDescriptionprotected ml.dmlc.xgboost4j.java.DMatrix
XGBoostExternalModel.convertFeatures
(SparseVector input) protected static ml.dmlc.xgboost4j.java.DMatrix
XGBoostTrainer.convertSparseVector
(SparseVector vector) Used when predicting with an externally trained XGBoost model.Modifier and TypeMethodDescriptionprotected ml.dmlc.xgboost4j.java.DMatrix
XGBoostExternalModel.convertFeaturesList
(List<SparseVector> input) protected static ml.dmlc.xgboost4j.java.DMatrix
XGBoostTrainer.convertSparseVectors
(List<SparseVector> vectors) Used when predicting with an externally trained XGBoost model. -
Uses of SparseVector in org.tribuo.interop
Modifier and TypeMethodDescriptionprotected abstract U
ExternalModel.convertFeatures
(SparseVector input) Converts from a SparseVector using the external model's indices into the ingestion format for the external model.Modifier and TypeMethodDescriptionprotected abstract U
ExternalModel.convertFeaturesList
(List<SparseVector> input) Converts from a list of SparseVector using the external model's indices into the ingestion format for the external model. -
Uses of SparseVector in org.tribuo.interop.oci
Modifier and TypeMethodDescriptionprotected DenseMatrix
OCIModel.convertFeatures
(SparseVector sparseVector) Modifier and TypeMethodDescriptionprotected DenseMatrix
OCIModel.convertFeaturesList
(List<SparseVector> list) -
Uses of SparseVector in org.tribuo.interop.onnx
Modifier and TypeMethodDescriptionprotected ai.onnxruntime.OnnxTensor
ONNXExternalModel.convertFeatures
(SparseVector input) ai.onnxruntime.OnnxTensor
DenseTransformer.transform
(ai.onnxruntime.OrtEnvironment env, SparseVector vector) ai.onnxruntime.OnnxTensor
ExampleTransformer.transform
(ai.onnxruntime.OrtEnvironment env, SparseVector vector) Converts aSparseVector
representing the features into aOnnxTensor
.ai.onnxruntime.OnnxTensor
ImageTransformer.transform
(ai.onnxruntime.OrtEnvironment env, SparseVector vector) Modifier and TypeMethodDescriptionprotected ai.onnxruntime.OnnxTensor
ONNXExternalModel.convertFeaturesList
(List<SparseVector> input) ai.onnxruntime.OnnxTensor
DenseTransformer.transform
(ai.onnxruntime.OrtEnvironment env, List<SparseVector> vectors) ai.onnxruntime.OnnxTensor
ExampleTransformer.transform
(ai.onnxruntime.OrtEnvironment env, List<SparseVector> vectors) Converts a list ofSparseVector
s representing a batch of features into aOnnxTensor
.ai.onnxruntime.OnnxTensor
ImageTransformer.transform
(ai.onnxruntime.OrtEnvironment env, List<SparseVector> vectors) -
Uses of SparseVector in org.tribuo.interop.tensorflow
Modifier and TypeMethodDescriptionprotected TensorMap
TensorFlowFrozenExternalModel.convertFeatures
(SparseVector input) protected TensorMap
TensorFlowSavedModelExternalModel.convertFeatures
(SparseVector input) Modifier and TypeMethodDescriptionprotected TensorMap
TensorFlowFrozenExternalModel.convertFeaturesList
(List<SparseVector> input) protected TensorMap
TensorFlowSavedModelExternalModel.convertFeaturesList
(List<SparseVector> input) -
Uses of SparseVector in org.tribuo.math.kernel
Modifier and TypeMethodDescriptiondouble
Kernel.similarity
(SparseVector first, SparseVector second) Calculates the similarity between twoSparseVector
s.double
Linear.similarity
(SparseVector a, SparseVector b) double
Polynomial.similarity
(SparseVector a, SparseVector b) double
RBF.similarity
(SparseVector a, SparseVector b) double
Sigmoid.similarity
(SparseVector a, SparseVector b) -
Uses of SparseVector in org.tribuo.math.la
Modifier and TypeMethodDescriptionSparseVector.copy()
static SparseVector
SparseVector.createSparseVector
(int dimension, int[] indices, double[] values) Defensively copies the input, and checks that the indices are sorted.static SparseVector
SparseVector.createSparseVector
(int dimension, Map<Integer, Double> indexMap) Builds a SparseVector from a map.static <T extends Output<T>>
SparseVectorSparseVector.createSparseVector
(Example<T> example, ImmutableFeatureMap featureInfo, boolean addBias) Builds aSparseVector
from anExample
.DenseSparseMatrix.getRow
(int i) SparseVector.scale
(double coefficient) DenseVector.sparsify()
Generates aSparseVector
representation from this dense vector, removing all values with absolute value belowVectorTuple.DELTA
.DenseVector.sparsify
(double tolerance) Generates aSparseVector
representation from this dense vector, removing all values with absolute value below the supplied tolerance.static <T extends Output<T>>
SparseVector[]Converts a dataset of row-major examples into an array of column-major sparse vectors.static <T extends Output<T>>
SparseVector[]SparseVector.transpose
(Dataset<T> dataset, ImmutableFeatureMap fMap) Converts a dataset of row-major examples into an array of column-major sparse vectors.static SparseVector[]
SparseVector.transpose
(SparseVector[] input) Transposes an array of sparse vectors from row-major to column-major or vice versa.Modifier and TypeMethodDescriptionstatic DenseSparseMatrix
DenseSparseMatrix.createFromSparseVectors
(SparseVector[] values) Defensively copies the values.int[]
SparseVector.difference
(SparseVector other) Generates an array of the indices that are active in this vector but are not present inother
.int[]
SparseVector.intersection
(SparseVector other) Generates an array of the indices that are active in both this vector andother
static SparseVector[]
SparseVector.transpose
(SparseVector[] input) Transposes an array of sparse vectors from row-major to column-major or vice versa.ModifierConstructorDescriptionDenseSparseMatrix
(List<SparseVector> values) Constructs a DenseSparseMatrix out of the supplied sparse vector list. -
Uses of SparseVector in org.tribuo.math.util
Modifier and TypeMethodDescriptionstatic SparseVector
HeapMerger.merge
(List<SparseVector> vectors, int dimension, int[] indicesBuffer, double[] valuesBuffer) Merges a list of sparse vectors into a single sparse vector, summing the values.HeapMerger.merge
(SparseVector[] inputs) MatrixHeapMerger.merge
(SparseVector[] inputs) Merger.merge
(SparseVector[] inputs) Merges an array of SparseVector into a single SparseVector.Modifier and TypeMethodDescriptionHeapMerger.merge
(SparseVector[] inputs) MatrixHeapMerger.merge
(SparseVector[] inputs) Merger.merge
(SparseVector[] inputs) Merges an array of SparseVector into a single SparseVector.Modifier and TypeMethodDescriptionstatic SparseVector
HeapMerger.merge
(List<SparseVector> vectors, int dimension, int[] indicesBuffer, double[] valuesBuffer) Merges a list of sparse vectors into a single sparse vector, summing the values. -
Uses of SparseVector in org.tribuo.multilabel
Modifier and TypeMethodDescriptionMultiLabel.convertToSparseVector
(ImmutableOutputInfo<MultiLabel> info) Converts this MultiLabel into a SparseVector using the indices from the output info. -
Uses of SparseVector in org.tribuo.multilabel.sgd.fm
Modifier and TypeMethodDescriptionprotected SparseVector
FMMultiLabelTrainer.getTarget
(ImmutableOutputInfo<MultiLabel> outputInfo, MultiLabel output) -
Uses of SparseVector in org.tribuo.multilabel.sgd.linear
Modifier and TypeMethodDescriptionprotected SparseVector
LinearSGDTrainer.getTarget
(ImmutableOutputInfo<MultiLabel> outputInfo, MultiLabel output) -
Uses of SparseVector in org.tribuo.regression.impl
Modifier and TypeMethodDescriptionprotected SparseVector
SkeletalIndependentRegressionModel.createFeatures
(Example<Regressor> example) Creates the feature vector.protected SparseVector
SkeletalIndependentRegressionSparseModel.createFeatures
(Example<Regressor> example) Creates the feature vector.Modifier and TypeMethodDescriptionprotected abstract Regressor.DimensionTuple
SkeletalIndependentRegressionModel.scoreDimension
(int dimensionIdx, SparseVector features) Makes a prediction for a single dimension.protected abstract Regressor.DimensionTuple
SkeletalIndependentRegressionSparseModel.scoreDimension
(int dimensionIdx, SparseVector features) Makes a prediction for a single dimension.protected abstract T
SkeletalIndependentRegressionSparseTrainer.trainDimension
(double[] outputs, SparseVector[] features, float[] weights, SplittableRandom rng) Trains a single dimension of the possibly multiple dimensions.protected abstract T
SkeletalIndependentRegressionTrainer.trainDimension
(double[] outputs, SparseVector[] features, float[] weights, SplittableRandom rng) Trains a single dimension of the possibly multiple dimensions. -
Uses of SparseVector in org.tribuo.regression.sgd
Modifier and TypeMethodDescriptionstatic void
Util.shuffleInPlace
(SparseVector[] features, DenseVector[] regressors, double[] weights, int[] indices, SplittableRandom rng) In place shuffle of the features, labels and weights.static void
Util.shuffleInPlace
(SparseVector[] features, DenseVector[] regressors, double[] weights, SplittableRandom rng) In place shuffle of the features, labels and weights. -
Uses of SparseVector in org.tribuo.regression.slm
Modifier and TypeMethodDescriptionprotected SparseVector
SparseLinearModel.createFeatures
(Example<Regressor> example) Creates the feature vector.Modifier and TypeMethodDescriptionSparseLinearModel.getWeights()
Gets a copy of the model parameters.Modifier and TypeMethodDescriptionprotected Regressor.DimensionTuple
SparseLinearModel.scoreDimension
(int dimensionIdx, SparseVector features)
AbstractSGDTrainer.shuffleInPlace(org.tribuo.math.la.SGDVector[], T[], double[], java.util.SplittableRandom)
.