Skip to content

correction and split agreement into 2 functions#94

Open
MaelleTtrt wants to merge 1 commit intoProject-OSmOSE:mainfrom
MaelleTtrt:improve_agreement
Open

correction and split agreement into 2 functions#94
MaelleTtrt wants to merge 1 commit intoProject-OSmOSE:mainfrom
MaelleTtrt:improve_agreement

Conversation

@MaelleTtrt
Copy link
Member

I split the agreement into 2 functions
1-count_detections_within_timeframe that returns a dataframe containing counts of detections within a timeframe
2 - plot the R²
I also corrected the function agreement so that the last bin encompassed properly the dataset

    bins = date_range(
        start=df["start_datetime"].min().floor(bin_size),
        end=df["end_datetime"].max().ceil(bin_size),
        freq=freq,
    )


bar_kwargs = {
"width": bar_width.total_seconds() / 86400,
"width": (bar_width.total_seconds() / 86400),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why parenthesis here ?

"id": "6a230b00c14cc64e",
"metadata": {},
"outputs": [],
"metadata": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you dete all outputs of notebooks before if you push it to the repo
Also, i think this file has nothing to do with your edits so you should take it out of your PR

It also fits and plots a linear regression line and displays the coefficient
of determination (R²) on the plot.
) -> DataFrame:
"""Counts the number of detections in df within bin_size timeframe.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"""Count the number of detections in an APLOSE dataframe within bin_size time bin.```

Ruff D401: First line of docstring should be in imperative mood

Matplotlib axes object where the scatterplot and regression line will be drawn.
Returns
-------
df_hist: Dataframe with columns = annotators and lines = number of detections
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

df_hist: DataFrame
    A  Dataframe with columns correposnding to the annotators
    and lines corresponding to the number of detections


# scatter plot
n_annot_max = bin_size.total_seconds() / df["end_time"].iloc[0]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this empty line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants