I have a dataset with binary output ($Y$) and I have a column (Duration) contains the duration of each task that is stored by "days" and varied from 1day to 350 days.
when I think logically in our situation, I can deduce that the probability of getting a positive output value ($Y = 1$) require to have small duration task.
But I need to justify my opinion with some plots
I have tried the following source code but It doesn't represent correctly my assumption.
#LoadData min_duration = plot_data['Duration'].min() max_duration = plot_data['Duration'].max() xr_ = list(range(min_duration, max_duration, 5)) y_ =  for i in range(0,(len(xr_)-1)): a_ = np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1]) b_ = np.logical_and(np.logical_and(plot_data['Duration'].values >= xr_[i], plot_data['Duration'].values < xr_[i+1]), plot_data['output'].values==1) y_.append(sum(b_)/sum(a_)) import matplotlib matplotlib.pyplot.plot(xr_[1:len(xr_)], y_, 'o')
Based on my previous assumption I must get a plot which contains an exponential form like :
But I have got contrary the following plot:
I want to know where I have a mistake and If there is any other method to justify my assumption