zscore_chats_and_conversation module
- utils.zscore_chats_and_conversation.get_zscore_across_all_chats(chats_data, on_column)
Calculate the z-score of a specified column for each chat message across the entire dataset.
This function computes the z-score for the values in the specified numeric column, comparing each value to the mean and standard deviation of that column across all chat messages in the dataset.
- Parameters:
chats_data (pandas.DataFrame) – The DataFrame containing chat data, where each row represents one message.
on_column (str) – The name of the numeric column on which the z-score is to be calculated.
- Returns:
A Series containing the z-scores for each message in the specified column.
- Return type:
pandas.Series
- utils.zscore_chats_and_conversation.get_zscore_across_all_conversations(chats_data, on_column, conversation_id_col)
Calculate the z-score of a specified column for each chat message within each conversation.
This function computes the z-score for the values in the specified numeric column, comparing each value to the mean and standard deviation of that column within each conversation.
- Parameters:
chats_data (pandas.DataFrame) – The DataFrame containing chat data, where each row represents one message.
on_column (str) – The name of the numeric column on which the z-score is to be calculated.
conversation_id_col (str) – A string representing the column name that should be selected as the conversation ID. Defaults to “conversation_num”.
- Returns:
A Series containing the z-scores for each message in the specified column within each conversation.
- Return type:
pandas.Series