Skip to content

rotor_clustering

DBSCANRotorClustering

Bases: RotorClustering

Clusters rotors with positive/negative rotation direction seperately in time and space simultaneously using the DBSCAN algorithm.

The t ime and space feature spaces are rescaled by a certain weight to yield more importance to one or the other.

coords = coords instance-attribute

model = DBSCAN(eps=eps, min_samples=min_samples) instance-attribute

space_scale = 1 instance-attribute

space_weight = 1 instance-attribute

time_scale = 1 instance-attribute

time_weight = 1 instance-attribute

__init__(rotors, coords, eps=2, min_samples=3)

Parameters:

Name Type Description Default
eps float

Clustering radius used in DBSCAN. Default to 2.

2
min_samples int

Min amount of cluster samples required for a point that is part if this cluster to be classified as a core point. Defaults to 3.

3

cluster()

Clusters the rotors with positive/negative rotation direction separately in time and space simultaneously.

Returns:

Type Description
DataFrame

DataFrame with columns ['t_ind', 'x', 'y', 'z', 'direction', 'cluster', 'cluster_size'].

project_on_mesh(rotors_cl)

Projects rotor positions on mesh by replacing with the nearest mesh node.

Parameters:

Name Type Description Default
rotors_cl DataFrame

DataFrame with columns ['t_ind', 'x', 'y', 'z', 'direction', 'cluster', 'cluster_size'].

required

Returns:

Type Description
DataFrame

pd.DataFrame: DataFrame with columns ['t_ind', 'node_ind', 'direction', 'cluster', 'cluster_size'].

reduce_clusters(rotors_cl)

Reduces rotors to the cluster center for each time.

Parameters:

Name Type Description Default
rotors_cl DataFrame

Dataframe with columns ['t_ind', 'x', 'y', 'z', 'direction', 'cluster', 'cluster_size'].

required

Returns:

Type Description
DataFrame

pd.DataFrame: Dataframe with columns ['t_ind', 'x', 'y', 'z', 'direction', 'cluster', 'cluster_size'].

set_space_scale(space_scale)

Distance between nodes Default: 1

set_space_weight(space_weight)

Space feature space scaling factor Default: 1

set_time_scale(time_scale)

Time between frames Default: 1

set_time_weight(time_weight)

Time feature space weight factor Default: 1