Bering.tools.node_classification
- Bering.tools.node_classification(bg, df_spots, n_neighbors=10, beta=1.0, prob_threshold=0.3, max_num_spots=1500000, num_chunks=25)[source]
Node classification for all spots in the slice
- Parameters:
bg (BrGraph) – Bering Graph object
df_spots (pd.DataFrame) – spots table. It can be
bg.spots_allin case of whole slice predictionn_neighbors (int) – number of neighbors for graph construction
prob_threshold (float) – minimal threshold of predicted probability for spots to be considered as foreground
max_num_spots (int) – maximum number of spots for node classification in each chunk. If the number of spots is larger than this number, the spots table will be split into chunks by coordinates.
num_chunks (int) – number of chunks for node classification. This is done by splitting the spots table into chunks by coordinates. This is used when the number of spots is too large. Refer to _get_node_embedding_prediction_byTiling for details.
- Returns:
: preds_labels: np.array
predicted labels for all spots
- graph_all: torch_geometric.data.Data
graph (
torch_geometric.data.Dataobject) for the whole slice