public class PowerIterationClustering extends Object implements DefaultParamsWritable
This class is not yet an Estimator/Transformer, use assignClusters
method to run the
PowerIterationClustering algorithm.
Constructor and Description |
---|
PowerIterationClustering() |
Modifier and Type | Method and Description |
---|---|
Dataset<Row> |
assignClusters(Dataset<?> dataset)
Run the PIC algorithm and returns a cluster assignment for each input vertex.
|
static Params |
clear(Param<?> param) |
PowerIterationClustering |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
static Param<String> |
dstCol() |
Param<String> |
dstCol()
Name of the input column for destination vertex IDs.
|
static String |
explainParam(Param<?> param) |
static String |
explainParams() |
static ParamMap |
extractParamMap() |
static ParamMap |
extractParamMap(ParamMap extra) |
static <T> scala.Option<T> |
get(Param<T> param) |
static <T> scala.Option<T> |
getDefault(Param<T> param) |
static String |
getDstCol() |
String |
getDstCol() |
static String |
getInitMode() |
String |
getInitMode() |
static int |
getK() |
int |
getK() |
static int |
getMaxIter() |
static <T> T |
getOrDefault(Param<T> param) |
static Param<Object> |
getParam(String paramName) |
static String |
getSrcCol() |
String |
getSrcCol() |
static String |
getWeightCol() |
static <T> boolean |
hasDefault(Param<T> param) |
static boolean |
hasParam(String paramName) |
static Param<String> |
initMode() |
Param<String> |
initMode()
Param for the initialization algorithm.
|
static boolean |
isDefined(Param<?> param) |
static boolean |
isSet(Param<?> param) |
static IntParam |
k() |
IntParam |
k()
The number of clusters to create (k).
|
static PowerIterationClustering |
load(String path) |
static IntParam |
maxIter() |
static Param<?>[] |
params() |
static void |
save(String path) |
static <T> Params |
set(Param<T> param,
T value) |
PowerIterationClustering |
setDstCol(String value) |
PowerIterationClustering |
setInitMode(String value) |
PowerIterationClustering |
setK(int value) |
PowerIterationClustering |
setMaxIter(int value) |
PowerIterationClustering |
setSrcCol(String value) |
PowerIterationClustering |
setWeightCol(String value) |
static Param<String> |
srcCol() |
Param<String> |
srcCol()
Param for the name of the input column for source vertex IDs.
|
static String |
toString() |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
static Param<String> |
weightCol() |
static MLWriter |
write() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaxIter, maxIter
getWeightCol, weightCol
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
write
save
public static PowerIterationClustering load(String path)
public static String toString()
public static Param<?>[] params()
public static String explainParam(Param<?> param)
public static String explainParams()
public static final boolean isSet(Param<?> param)
public static final boolean isDefined(Param<?> param)
public static boolean hasParam(String paramName)
public static Param<Object> getParam(String paramName)
public static final <T> scala.Option<T> get(Param<T> param)
public static final <T> T getOrDefault(Param<T> param)
public static final <T> scala.Option<T> getDefault(Param<T> param)
public static final <T> boolean hasDefault(Param<T> param)
public static final ParamMap extractParamMap()
public static final IntParam maxIter()
public static final int getMaxIter()
public static final Param<String> weightCol()
public static final String getWeightCol()
public static final IntParam k()
public static int getK()
public static final Param<String> initMode()
public static String getInitMode()
public static Param<String> srcCol()
public static String getSrcCol()
public static Param<String> dstCol()
public static String getDstCol()
public static void save(String path) throws java.io.IOException
java.io.IOException
public static MLWriter write()
public String uid()
Identifiable
public PowerIterationClustering setK(int value)
public PowerIterationClustering setInitMode(String value)
public PowerIterationClustering setMaxIter(int value)
public PowerIterationClustering setSrcCol(String value)
public PowerIterationClustering setDstCol(String value)
public PowerIterationClustering setWeightCol(String value)
public Dataset<Row> assignClusters(Dataset<?> dataset)
dataset
- A dataset with columns src, dst, weight representing the affinity matrix,
which is the matrix A in the PIC paper. Suppose the src column value is i,
the dst column value is j, the weight column value is similarity s,,ij,,
which must be nonnegative. This is a symmetric matrix and hence
s,,ij,, = s,,ji,,. For any (i, j) with nonzero similarity, there should be
either (i, j, s,,ij,,) or (j, i, s,,ji,,) in the input. Rows with i = j are
ignored, because we assume s,,ij,, = 0.0.
public PowerIterationClustering copy(ParamMap extra)
Params
defaultCopy()
.extra
- (undocumented)public Param<String> dstCol()
public String getDstCol()
public String getInitMode()
public int getK()
public String getSrcCol()
public Param<String> initMode()
public IntParam k()
public Param<String> srcCol()