public class BucketedRandomProjectionLSH extends Estimator<T> implements BucketedRandomProjectionLSHParams, HasSeed
This BucketedRandomProjectionLSH
implements Locality Sensitive Hashing functions for
Euclidean distance metrics.
The input is dense or sparse vectors, each of which represents a point in the Euclidean distance space. The output will be vectors of configurable dimension. Hash values in the same dimension are calculated by the same hash function.
References:
1. Wikipedia on Stable Distributions
2. Wang, Jingdong et al. "Hashing for similarity search: A survey." arXiv preprint arXiv:1408.2927 (2014).
Constructor and Description |
---|
BucketedRandomProjectionLSH() |
BucketedRandomProjectionLSH(String uid) |
Modifier and Type | Method and Description |
---|---|
BucketedRandomProjectionLSH |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
T |
fit(Dataset<?> dataset)
Fits a model to the input data.
|
static BucketedRandomProjectionLSH |
load(String path) |
static MLReader<T> |
read() |
BucketedRandomProjectionLSH |
setBucketLength(double value) |
BucketedRandomProjectionLSH |
setInputCol(String value) |
BucketedRandomProjectionLSH |
setNumHashTables(int value) |
BucketedRandomProjectionLSH |
setOutputCol(String value) |
BucketedRandomProjectionLSH |
setSeed(long value) |
StructType |
transformSchema(StructType schema)
:: DeveloperApi ::
|
String |
uid()
An immutable unique ID for the object and its derivatives.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bucketLength, getBucketLength
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
toString
getNumHashTables, numHashTables, validateAndTransformSchema
getInputCol, inputCol
getOutputCol, outputCol
write
save
initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public BucketedRandomProjectionLSH(String uid)
public BucketedRandomProjectionLSH()
public static BucketedRandomProjectionLSH load(String path)
public static MLReader<T> read()
public String uid()
Identifiable
uid
in interface Identifiable
public BucketedRandomProjectionLSH setInputCol(String value)
public BucketedRandomProjectionLSH setOutputCol(String value)
public BucketedRandomProjectionLSH setNumHashTables(int value)
public BucketedRandomProjectionLSH setBucketLength(double value)
public BucketedRandomProjectionLSH setSeed(long value)
public StructType transformSchema(StructType schema)
PipelineStage
Check transform validity and derive the output schema from the input schema.
We check validity for interactions between parameters during transformSchema
and
raise an exception if any parameter value is invalid. Parameter value checks which
do not depend on other parameters are handled by Param.validate()
.
Typical implementation should first conduct verification on schema change and parameter validity, including complex parameter interaction checks.
transformSchema
in class PipelineStage
schema
- (undocumented)public BucketedRandomProjectionLSH copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Estimator<BucketedRandomProjectionLSHModel>
extra
- (undocumented)