public abstract class TrainableDistanceMetric extends Object implements DistanceMetric
Constructor and Description |
---|
TrainableDistanceMetric() |
Modifier and Type | Method and Description |
---|---|
abstract TrainableDistanceMetric |
clone() |
abstract boolean |
needsTraining()
Returns true if the metric needs to be trained.
|
abstract boolean |
supportsClassificationTraining()
Some metrics might be special purpose, and not trainable for all types of data sets or tasks.
|
abstract boolean |
supportsRegressionTraining()
Some metrics might be special purpose, and not trainable for all types of data sets tasks.
|
abstract void |
train(ClassificationDataSet dataSet)
Trains this metric on the given classification problem data set
|
abstract void |
train(ClassificationDataSet dataSet,
ExecutorService threadpool)
Trains this metric on the given classification problem data set
|
abstract void |
train(DataSet dataSet)
Trains this metric on the given data set
|
abstract void |
train(DataSet dataSet,
ExecutorService threadpool)
Trains this metric on the given data set
|
abstract <V extends Vec> |
train(List<V> dataSet)
Trains this metric on the given data set
|
abstract <V extends Vec> |
train(List<V> dataSet,
ExecutorService threadpool)
Trains this metric on the given data set
|
abstract void |
train(RegressionDataSet dataSet)
Trains this metric on the given regression problem data set
|
abstract void |
train(RegressionDataSet dataSet,
ExecutorService threadpool)
Trains this metric on the given regression problem data set
|
static void |
trainIfNeeded(DistanceMetric dm,
DataSet dataset)
Static helper method for training a distance metric only if it is needed.
|
static void |
trainIfNeeded(DistanceMetric dm,
DataSet dataset,
ExecutorService threadpool)
Static helper method for training a distance metric only if it is needed.
|
static <V extends Vec> |
trainIfNeeded(DistanceMetric dm,
List<V> dataset)
Static helper method for training a distance metric only if it is needed.
|
static <V extends Vec> |
trainIfNeeded(DistanceMetric dm,
List<V> dataset,
ExecutorService threadpool) |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dist, dist, dist, dist, getAccelerationCache, getAccelerationCache, getQueryInfo, isIndiscemible, isSubadditive, isSymmetric, metricBound, supportsAcceleration, toString
public abstract <V extends Vec> void train(List<V> dataSet)
V
- the type of vectors in the listdataSet
- the data set to train onUnsupportedOperationException
- if the metric can not be trained from unlabeled datapublic abstract <V extends Vec> void train(List<V> dataSet, ExecutorService threadpool)
V
- the type of vectors in the listdataSet
- the data set to train onthreadpool
- the source of threads for parallel trainingUnsupportedOperationException
- if the metric can not be trained from unlabeled datapublic abstract void train(DataSet dataSet)
dataSet
- the data set to train onUnsupportedOperationException
- if the metric can not be trained from unlabeled datapublic abstract void train(DataSet dataSet, ExecutorService threadpool)
dataSet
- the data set to train onthreadpool
- the source of threads for parallel trainingUnsupportedOperationException
- if the metric can not be trained from unlabeled datapublic abstract void train(ClassificationDataSet dataSet)
dataSet
- the data set to train onUnsupportedOperationException
- if the metric can not be trained from classification problemspublic abstract void train(ClassificationDataSet dataSet, ExecutorService threadpool)
dataSet
- the data set to train onthreadpool
- the source of threads for parallel trainingUnsupportedOperationException
- if the metric can not be trained from classification problemspublic abstract boolean supportsClassificationTraining()
public abstract void train(RegressionDataSet dataSet)
dataSet
- the data set to train onUnsupportedOperationException
- if the metric can not be trained from regression problemspublic abstract void train(RegressionDataSet dataSet, ExecutorService threadpool)
dataSet
- the data set to train onthreadpool
- the source of threads for parallel trainingUnsupportedOperationException
- if the metric can not be trained from regression problemspublic abstract boolean supportsRegressionTraining()
public abstract boolean needsTraining()
public abstract TrainableDistanceMetric clone()
clone
in interface DistanceMetric
clone
in class Object
public static void trainIfNeeded(DistanceMetric dm, DataSet dataset)
dm
- the distance metric to traindataset
- the data set to train frompublic static void trainIfNeeded(DistanceMetric dm, DataSet dataset, ExecutorService threadpool)
dm
- the distance metric to traindataset
- the data set to train fromthreadpool
- the source of threads for parallel training. May be
null, in which case trainIfNeeded(jsat.linear.distancemetrics.DistanceMetric, jsat.DataSet)
is used instead.public static <V extends Vec> void trainIfNeeded(DistanceMetric dm, List<V> dataset)
V
- the type of vectors in the listdm
- the distance metric to traindataset
- the data set to train frompublic static <V extends Vec> void trainIfNeeded(DistanceMetric dm, List<V> dataset, ExecutorService threadpool)
V
- the type of vectors in the listdm
- the distance metric to traindataset
- the data set to train fromthreadpool
- the source of threads for parallel training. May be
null, in which case trainIfNeeded(jsat.linear.distancemetrics.DistanceMetric, java.util.List)
is used instead.Copyright © 2017. All rights reserved.