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

Request for clarification: "elapsed time" #5

Open
yongyi-wu opened this issue Jun 7, 2021 · 0 comments
Open

Request for clarification: "elapsed time" #5

yongyi-wu opened this issue Jun 7, 2021 · 0 comments

Comments

@yongyi-wu
Copy link

Hello,

In KT1, does the elapsed_time correpond to the prior question, as the case in the Kaggle competition, or to the current question? Also, is it the average time spent on questions from the same bundle?

Specifically, could you explain why the lag_time computed below can contain negative values:

import pandas as pd

df = pd.read_csv('u42.csv')
bundle_size = dict(df.groupby('solving_id').size())

if not df['timestamp'].is_monotonic_increasing: 
    df = df.sort_values('timestamp')

df['lag_time'] = df.apply(
    lambda r: 
        0 if r.name == 0 or r['solving_id'] == df.loc[r.name - 1, 'solving_id'] 
        else r['timestamp'] - (df.loc[r.name - bundle_size[r['solving_id'] - 1], 'timestamp'] + df.loc[r.name - 1, 'elapsed_time'] * bundle_size[r['solving_id'] - 1]), 
    axis=1
).squeeze()

print(df[df['lag_time'] < 0])

Thank you.

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