Giter Club home page Giter Club logo

class_survival_101's Introduction

How to Use Survival to Predict Churn (in R)

by Pasha Roberts ~ Chief Scientist, Talent Analytics

Context

Demo code supporting various presentations and classes about Prediction with Survival Analytics.

The Slides

The slides are now online in this repository. The easiest way to view them is to look at the PDF: slides/survival_101.pdf.

They are actually HTML slides produced with remark - if you clone this repository and open slides/survival_101.html in a browser, then you'll see a nice powerpoint-like presentation in your browser. Type "?" to get the list of commands that you can use while walking through the slides. Much better than powerpoint if you are comfortable with text.

The Code

The code is in code/survival101.R. The functions include:

  • demoETL() walks through the conversion of raw HR data into a data frame usable for survival analytics.
  • demoPrediction() walks through creating a survival curve, predicting a proportional hazard model, and validating the model.
  • genAttritionData() generates a random attrition dataset.
  • genRandomSpans() generates random employment spans.
  • survFitData() transforms a survival::survfit object into a usable R data.frame.
  • plotSurvFit() makes a ggplot2 plot of a survival curve
  • plotSurvAUC() makes a ggplot2 plot of an AUC curve

class_survival_101's People

Contributors

pasha2718 avatar

Watchers

 avatar  avatar

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.