Body: <p>I'm using the Python package <em>lifelines</em> to build a CoxPH model where I reduce the step size to 0.1, like so:</p>
  <pre><code>cph = CoxPHFitter()
  cph.fit(df, 'time', 'event', fit_options = {&quot;step_size&quot;:0.1})
  </code></pre>
  <p>I used k_fold_cross_validation to build the model, but I don't know how to add in step size. I expected to add it to fitter_kwargs, like this, but this does not work:</p>
  <pre><code>k_fold_cross_validation(cph, df, duration_col='time', event_col='event', k=5, fitter_kwargs={fit_options:{&quot;step_size&quot;:0.1}})
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-01T12:37:11.533Z
Comments.Text: have you tried simply cph.fit(df, 'time', 'event', step_size=0.1} ?
Comments.UserDisplayName: JRodrigoF
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-01T14:10:46.343Z
Comments.Text: @JRodrigoF I wouldn't be able to do cross-validation then
Comments.UserDisplayName: skubali
Tags: <python>
Title: Adding step size to cross validation in Python package lifelines
ThreadText: # Adding step size to cross validation in Python package lifelines
  
  (Asked by: username_0 on 2023-10-31)
  
  I'm using the Python package *lifelines* to build a CoxPH model where I reduce the step size to 0.1, like so:
  
  ```
  cph = CoxPHFitter()
  cph.fit(df, 'time', 'event', fit_options = {"step_size":0.1})
  
  ```
  
  I used k\_fold\_cross\_validation to build the model, but I don't know how to add in step size. I expected to add it to fitter\_kwargs, like this, but this does not work:
  
  ```
  k_fold_cross_validation(cph, df, duration_col='time', event_col='event', k=5, fitter_kwargs={fit_options:{"step_size":0.1}})
  
  ```
  
  **Tags:** python
  
  > **Comments:**
  > **username_1**: have you tried simply cph.fit(df, 'time', 'event', step_size=0.1} ?  
  > **username_0**: @username_1 I wouldn't be able to do cross-validation then  
  
  ---
  
  ## 0 answers
  
  