public class PolynomialExpansion extends UnaryTransformer<Vector,Vector,PolynomialExpansion>
http://en.wikipedia.org/wiki/Polynomial_expansion
, "In mathematics, an
expansion of a product of sums expresses it as a sum of products by using the fact that
multiplication distributes over addition". Take a 2-variable feature vector as an example:
(x, y)
, if we want to expand it with degree 2, then we get (x, x * x, y, x * y, y * y)
.Constructor and Description |
---|
PolynomialExpansion() |
PolynomialExpansion(String uid) |
Modifier and Type | Method and Description |
---|---|
PolynomialExpansion |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
IntParam |
degree()
The polynomial degree to expand, which should be >= 1.
|
int |
getDegree() |
static PolynomialExpansion |
load(String path) |
PolynomialExpansion |
setDegree(int value) |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
setInputCol, setOutputCol, transform, transformSchema
transform, transform, transform
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn, validateParams
toString
public PolynomialExpansion(String uid)
public PolynomialExpansion()
public static PolynomialExpansion load(String path)
public String uid()
Identifiable
public IntParam degree()
public int getDegree()
public PolynomialExpansion setDegree(int value)
public PolynomialExpansion copy(ParamMap extra)
Params
copy
in interface Params
copy
in class UnaryTransformer<Vector,Vector,PolynomialExpansion>
extra
- (undocumented)defaultCopy()