Code Monkey home page Code Monkey logo

Comments (3)

sebp avatar sebp commented on June 15, 2024 1

If somebody could post quick minimal example how you create this structured array from two lists, that would be very helpfu

I usually use numpy.fromiter as in this line.

It seems there are a couple of related issues,

  1. Construction of structured array is not straight-forward.
  2. Supporting passing a 2-column pandas DataFrame instead of structured array.
  3. Allow for censoring indicator to be an array of 0/1 instead of boolean.

I believe it would be best to add a function equivalent to R's Surv that converts different inputs to the structured array format used internally.

from scikit-survival.

region-spotteR avatar region-spotteR commented on June 15, 2024

Absolutely for it! I think am quite capable in programming. But I still have no clue, how to get to the structured arrays and I've been trying for a while now! I know my python-skills are a bit rusty - but not this much.

If somebody could post quick minimal example how you create this structured array from two lists, that would be very helpful. Maybe add it to the example Python Notebook. Thanks

from scikit-survival.

plpxsk avatar plpxsk commented on June 15, 2024

@region-spotteR I use a pandas dataframe -> structured array workflow. Say you have pandas df with 2 columns: status and time. Convert status to bool and then convert the 2 columns into structured array

df.status = df.status.astype('bool')
df.to_records(index=False)

to recap, the point of this thread is to discuss/request that we don't need the first line

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.