-
Notifications
You must be signed in to change notification settings - Fork 10
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
Model Prediction and Model loading #2
Comments
Thanks for giving the code a shot! Could you provide more information about From this line
|
Actually I was trying to load the trained model to predict the hazard ratio of incoming data. But I took a step back and tried in-session prediction right after training. Would you provide example on how to do prediction (hazard_ratio, log_risk etc) using saved model? |
At the moment I am focusing on some other projects. I may not get to that in a timely manner. I tried to make the demo helpful, but of course I am sure there are many things (such as using a saved model) missing that would be helpful to many users. If other users are willing to push more ipython notebook examples that would be welcomed, as I do not plan on adding more examples any time soon. Also, freely submit pull requests as you try new things. Even if they are small things. I would be very accepting of ipython notebook demos. I am sure more examples could benefit someone else. |
I found that it doesn't load model for some reason. Maybe it's windows specific?
A quick fix change path checking in predict function from:
assert os.path.exists(self.params.modelPath)
to
assert os.path.exists(os.path.dirname(self.params.modelPath))
But when I try to predict after training,
ds_tf = deepsurv_tf.DeepSurvTF(params)
stats = ds_tf.train(train, valid)
ds_tf.predict(valid['x'])
The follow error occur:
--> 291 risk = sess.run([risk], feed_dict = {self.x : testXdata})
UnboundLocalError: local variable 'risk' referenced before assignment
The text was updated successfully, but these errors were encountered: