ECLE has moved! Our new address is: 187 Commercial Blvd, Torrington, CT 06790
Your browser is out of date.
You are currently using Internet Explorer 7/8/9, which is not supported by our site. For the best experience, please use one of the latest browsers.
It sounds like you want to build a feature related to — likely a model or data pipeline to predict or identify the winner of American horse races (Carreras Americanas).
# Average speed figure last 3 races race_history_df['avg_speed_last3'] = ( race_history_df.groupby('horse_id')['speed_figure'] .transform(lambda x: x.rolling(3, min_periods=1).mean()) ) winner carreras americanas
# Rolling win rate (last 5 races) race_history_df['win_rate_last5'] = ( race_history_df.groupby('horse_id')['is_winner'] .transform(lambda x: x.rolling(5, min_periods=1).mean()) ) It sounds like you want to build a
# Distance-specific win rate (precomputed per horse) race_history_df['dist_win_rate'] = ( race_history_df.groupby(['horse_id', 'distance'])['is_winner'] .transform('mean') ) winner carreras americanas
# Days since last race race_history_df['days_since_last'] = ( race_history_df.groupby('horse_id')['race_date'].diff().dt.days )