VeraGridEngine.Simulations.Clustering packageο
Submodulesο
VeraGridEngine.Simulations.Clustering.clustering moduleο
- VeraGridEngine.Simulations.Clustering.clustering.kmeans_approximate_sampling(x_input: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], n_points: int = 10) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[float64]]][source]ο
K-Means clustering, corrected to the closest points :param x_input: Injections matrix (time, bus) :param n_points: number of clusters :return: indices of the closest to the cluster centers, deviation of the closest representatives
- VeraGridEngine.Simulations.Clustering.clustering.kmeans_sampling(x_input: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], n_points: int = 10) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[float64]], ndarray[tuple[Any, ...], dtype[int64]]][source]ο
K-Means clustering, fit to the closest points :param x_input: matrix to evaluate (time, params) :param n_points: number of clusters :return: indices of the closest to the cluster centers,
deviation of the closest representatives, array signifying to which cluster does each simulation belong
- VeraGridEngine.Simulations.Clustering.clustering.spectral_approximate_sampling(x_input: ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[int, int], dtype[float64]], n_points: int = 10) Tuple[ndarray[tuple[Any, ...], dtype[int64]], ndarray[tuple[Any, ...], dtype[float64]], int][source]ο
K-Means clustering, corrected to the closest points :param x_input: Injections matrix (time, bus) :param n_points: number of clusters :return: indices of the closest to the cluster centers, deviation of the closest representatives
VeraGridEngine.Simulations.Clustering.clustering_driver moduleο
- class VeraGridEngine.Simulations.Clustering.clustering_driver.ClusteringDriver(grid: MultiCircuit, options: ClusteringAnalysisOptions)[source]ο
Bases:
DriverTemplate- name = 'Clustering analysis'ο
- options: ClusteringAnalysisOptionsο
- tpe = 'Clustering Analysis'ο
VeraGridEngine.Simulations.Clustering.clustering_options moduleο
- class VeraGridEngine.Simulations.Clustering.clustering_options.ClusteringAnalysisOptions(n_points: int)[source]ο
Bases:
OptionsTemplate- CLASS_NON_EDITABLE_PROPERTIES: Tuple[str, ...] = ('idtag', 'diff_changes')ο
- CLASS_PROPERTIES_WITH_PROFILE: Dict[str, str] = {}ο
- CLASS_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:n_points)ο
- CLASS_PROPERTY_LIST: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:n_points)ο
- CLASS_REGISTERED_PROPERTIES: Dict[str, GCProp] = {'action': prop:action, 'code': prop:code, 'comment': prop:comment, 'diff_changes': prop:diff_changes, 'idtag': prop:idtag, 'n_points': prop:n_points, 'name': prop:name, 'rdfid': prop:rdfid}ο
- action: ActionTypeο
- comment: strο
- device_type: DeviceTypeο
- diff_changesο
- selected_to_mergeο
VeraGridEngine.Simulations.Clustering.clustering_results moduleο
- class VeraGridEngine.Simulations.Clustering.clustering_results.ClusteringResults(time_indices: ndarray[tuple[Any, ...], dtype[int64]], sampled_probabilities: ndarray[tuple[Any, ...], dtype[float64]], time_array: DatetimeIndex, original_sample_idx: ndarray[tuple[Any, ...], dtype[int64]])[source]ο
Bases:
ResultsTemplate- CLASS_DATA_VARIABLES = {'original_sample_idx': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'sampled_probabilities': <VeraGridEngine.Simulations.results_template.ResultsProperty object>, 'time_indices': <VeraGridEngine.Simulations.results_template.ResultsProperty object>}ο
- CLASS_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)ο
- LOCAL_RESULTS_DECLARATIONS = (<VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>, <VeraGridEngine.Simulations.results_template.ResultsProperty object>)ο
- mdl(result_type: ResultTypes) ResultsTable[source]ο
Plot the results. :param result_type: ResultTypes :return: ResultsModel
- original_sample_idx: IntVec | Noneο
- sampled_probabilities: Vec | Noneο
- time_indices: IntVec | Noneο