Code Monkey home page Code Monkey logo

Comments (6)

plpxsk avatar plpxsk commented on June 15, 2024

Your code looks good. I tried to reproduce your problem but couldn't.

  • can you print version of sksurv (import sksurv as sks; sks.__version__)?
  • Can you restart your kernel, then try the following snippet and paste the output?
%matplotlib inline
import matplotlib.pyplot as plt
from sksurv.nonparametric import kaplan_meier_estimator

import pandas as pd

df = pd.DataFrame(
    {'Canc': [False, False, True, False, True, False],
     'days': [693, 298, 52, 365, 361, 307]})
y = df.to_records(index=False)

time, survival_prob = kaplan_meier_estimator(y["Canc"], y["days"])
plt.step(time, survival_prob, where="post");

screen shot 2018-03-26 at 9 41 45 am

from scikit-survival.

thatemmagirl avatar thatemmagirl commented on June 15, 2024

Interesting - when trying to print the version on sksurv it states 'unknown'. I think this is because I had to add a line of code '# coding: utf-8' to the top of the .py file 'nonparametric' in the package to fix this error:
image

have you seen this error before? If so, what did you do to deal with it?

When I copied in your code I got this:
image

from scikit-survival.

sebp avatar sebp commented on June 15, 2024

Adding # coding: utf-8 should not be necessary with Python 3, which handles utf-8 encoded files by default, which suggests you are mixing Python 2 and 3.

Could you please post more details about your setup, please:

  • How did you install scikit-survival?
  • What's your Python version?
  • What's your numpy version?
  • What's your scipy version?
  • What's your matplotlib version?

You can use pandas.show_versions().

from scikit-survival.

thatemmagirl avatar thatemmagirl commented on June 15, 2024

My python version is 2.7
Numpy version is 1.13.1
Scipy version is 0.19.1
Matplotlib version is 1.5.3

I do not have administrative rights on my computer so someone else downloaded scikit-survival for me but I'm assuming they installed it using pip.

from scikit-survival.

sebp avatar sebp commented on June 15, 2024

Python 2 is not supported, only Python 3. Could you please try your example in a Python 3 environment?

from scikit-survival.

sebp avatar sebp commented on June 15, 2024

I'm closing this issue as no further information has been provided. Please feel free to reopen this issue if you can provide the requested information.

from scikit-survival.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.