Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag TX_DURING_NIGHT improvement #10

Open
DataDavidProjects opened this issue Jan 18, 2023 · 0 comments
Open

Flag TX_DURING_NIGHT improvement #10

DataDavidProjects opened this issue Jan 18, 2023 · 0 comments

Comments

@DataDavidProjects
Copy link

DataDavidProjects commented Jan 18, 2023

Congratulation!. This is the best work i have found for fraud detection and i hope you keep up.
I have noticed the function is_night is not working as expected due to the timestamp format.
image
In the last rows, you clearly see tx with timestamp around 23 not flagged with 1.

This is a possible solution to resolve the issue.

def is_night(tx_datetime):
    # Get the hour of the transaction
    tx_hour = tx_datetime.hour
    # Binary value: opposite of day ( day is hour between 6 and 18)
    is_night = not(tx_hour >= 6 and tx_hour <= 18)
    return int(is_night)

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

No branches or pull requests

1 participant