Open lotrus28 opened 4 years ago
I see now, that k_fold_cross_validation
maintained the arguments predictor
and evaluation_measure
in 0.23.9
, but after 0.24.0 - 2020-02-20
they disappear.
What is the reason for this?
Thanks for bringing this up @lotrus28
This part of the code is the least developed unfortunately. I'd be happy to see improvements/new functions added back to lifelines if you end up writing something. Honestly, I would be happy with as much as an overhaul to the API.
Otherwise, I'll dig into this for a future release, maybe in a few weeks.
@CamDavidsonPilon
Thank you for the quick response!
I decided not to write anything new and to just downgrade to 0.23.9
, since it has all the functionality that I need. It works fine, I guess.
I was just wondering if there was any significant reason you decided to ditch predictor
and evaluation_measure
from k_fold_cross_validation
. Those options are extremely useful, but if there was a bug prior to 0.24.0
, I think we should know.
To give some context on why I needed evaluation_measure
:
I wanted to select the best model based on how accurately it predicts 1 year survival status in CV.
This issue has useful bugs and information for me to improve lifelines, so I'd like to keep it open
Hello! I am using v 0.25.4 of lifelines I have recently started using lifelines and saw this in the documentation:
But when I tried feeding
predictor="predict_expectation"
intok_fold_cross_validation
I got this error:Apparently neither the function, nor any downstream functions (score, fit) not have a
predictor
parameter. I started looking around the lifelines code and then discovered some other issues. The documentation also contains mentions of theevaluation_measure
parameter, which should allow users to create custom quality metrics different fromconcordance_index
andlog_likelihood
, as long as that metrics can accept(event_times, predicted_event_times, event_observed)
as arguments. But using this parameter produces a similar error:On a side note, the
k_fold_cross_validation
code also contains this line:But
testing_columns
variable is not used anywhere. It seems to be a leftover either from earlier versions, or a reminder for a feature yet to be implemented.This was quite a letdown, when I discovered this. I trusted the documentation and expected to just plug in a function that assigns a quality score to a CPH model based on how many times it guessed right that a person survives for more than a week or a month. But neither can I do this, nor can I specify the type of prediction (median, expected...) used to calculate this score.
I think I will need to write a
custom_k_fold_cross_validation
function to implement my idea. But please clarify: were thepredictor
andevaluation_measure
present in some earlier versions oflifelines
? Or were these features announced in the documentation not so long ago and you are eventually going to implement these. And is thetesting_columns
variable indeed just a dangling end, or did I miss something important?