public class MinHashLSH extends Estimator<T> implements HasSeed
LSH class for Jaccard distance.
The input can be dense or sparse vectors, but it is more efficient if it is sparse. For example,
Vectors.sparse(10, Array((2, 1.0), (3, 1.0), (5, 1.0)))
means there are 10 elements in the space. This set contains elements 2, 3, and 5. Also, any
input vector must have at least 1 non-zero index, and all non-zero values are
treated as binary "1" values.
References: Wikipedia on MinHash
Constructor and Description |
---|
MinHashLSH() |
MinHashLSH(String uid) |
Modifier and Type | Method and Description |
---|---|
MinHashLSH |
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 MinHashLSH |
load(String path) |
static MLReader<T> |
read() |
MinHashLSH |
setInputCol(String value) |
MinHashLSH |
setNumHashTables(int value) |
MinHashLSH |
setOutputCol(String value) |
MinHashLSH |
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
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 static MinHashLSH load(String path)
public static MLReader<T> read()
public String uid()
Identifiable
uid
in interface Identifiable
public MinHashLSH setInputCol(String value)
public MinHashLSH setOutputCol(String value)
public MinHashLSH setNumHashTables(int value)
public MinHashLSH 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 MinHashLSH copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Estimator<MinHashLSHModel>
extra
- (undocumented)