Setting up a multilabel classification network with torch-dataframe

Working with multiple outcomes per input can be challenging. The image is cc by  Markus Lütkemeyer.
Working with multiple outcomes per input can be challenging. The image is cc by Markus Lütkemeyer.

A common situation is that you have an image that can represent more than one class, e.g. a image may both have an oil tanker and an oil platform. You also may have missing data for some of these that you don’t want to evaluate. In my research this problem occurs and my solution so far has been a my own criterion_ignore that sets the errors for ignore labels to zero. This post will be a quick look at how to combine the torch-dataframe with the criterion_ignore. Continue reading

Flattr this!

Posted in General | Leave a comment

Integration between torchnet and torch-dataframe – a closer look at the mnist example

It's all about the numbers and getting the tensors right. The image is cc by David Asch .
It’s all about the numbers and getting the tensors right. The image is cc by David Asch
.

In previous posts we’ve looked into the basic structure of the torch-dataframe package. In this post we’ll go through the [mnist example][mnist ex] that shows how to best integrate the dataframe with torchnet. Continue reading

Flattr this!

Posted in Deep learning, Torch, Tutorial | Leave a comment

The torch-dataframe – subsetting and sampling

Subsetting and batching is like dealing cards - should be random unless you are doing a trick. The image is cc from Steven Depolo.
Subsetting and batching is like dealing cards – should be random unless you are doing a trick. The image is cc from Steven Depolo.

In my previous two posts I covered the most basic data manipulation that you may need. In this post I’ll try to give a quick introduction to some of the sampling methods that we can use in our machine learning projects. Continue reading

Flattr this!

Posted in Deep learning, Torch, Tutorial | Leave a comment

The torch-dataframe – basics on modifications

Forming your data to your needs is crucial. The image i cc by Lennart Tange.
Forming your data to your needs is crucial. The image i cc by Lennart Tange.

In my [previous post][intro post] we took a look at some of the basic functionality. In this post I’ll try to show how to manipulate your dataframe. Note though, the [torch-dataframe][tdf github] is not about data munging, there are far more powerful tools in other languages for this. The aim of the modifications is to do simple tasks without being forced to switch to a different language. Continue reading

Flattr this!

Posted in Deep learning, Torch, Tutorial | Leave a comment

Deep learning with torch-dataframe – a gentle introduction to Torch

A solid concrete foundation is always important. The image is cc by  Sharon Pazner
A solid concrete foundation is always important. The image is cc by
Sharon Pazner

Handling tabular data is generally at the heart of most research projects. As I started exploring Torch that uses the Lua language for deep learning I was surprised that there was no package that would correspond to the functionality available in R’s data.frame. After some searching I found Alex Mili’s torch-dataframe package that I decided to update to my needs. We have during the past few months been developing the package and it has now made it onto the Torch cheat sheet (partly the reason for the posting scarcity lately). This series of posts provide a short introduction to the package (version 1.5) and examples of how to implement basic networks in Torch. Continue reading

Flattr this!

Posted in Deep learning, Torch, Tutorial | Leave a comment

Dealing with non-proportional hazards in R

As things change over time so should our statistical models. The image is CC by Prad Prathivi(
As things change over time so should our statistical models. The image is CC by Prad Prathivi

Since I’m frequently working with large datasets and survival data I often find that the proportional hazards assumption for the Cox regressions doesn’t hold. In my most recent study on cardiovascular deaths after total hip arthroplasty the coefficient was close to zero when looking at the period between 5 and 21 years after surgery. Grambsch and Thernau’s test for non-proportionality hinted though of a problem and as I explored it there was a clear correlation between mortality and hip arthroplasty surgery. The effect increased over time, just as we had originally thought, see below figure. In this post I’ll try to show how I handle with non-proportional hazards in R. Continue reading

Flattr this!

Posted in Orthopaedic surgery, R, Research, Tutorial | Tagged , , , | Leave a comment

LMWH – a Big Pharma bluff?

Tales of Big Pharma Horror. The image is CC from Mike Licht.
Tales of Big Pharma Horror. The image is CC from Mike Licht.

Thromboprophylaxis is a given for patients operated due to lower limb injuries, at least if we believe Big Pharma-studies. This dogma is now challenged by a double-blind, multi-center, RCT by Selby et al. They found that the DVT rate was much lower than expected and had to pull the plug on the study as it would be practically impossible to show a difference between placebo and LMWH. Continue reading

Flattr this!

Posted in Orthopaedic surgery, Research | Leave a comment

R trends in 2015 (based on cranlogs)

What are the current tRends? The image is CC from coco + kelly.
What are the current tRends? The image is CC from coco + kelly.

It is always fun to look back and reflect on the past year. Inspired by Christoph Safferling’s post on top packages from published in 2015, I decided to have my own go at the top R trends of 2015. Contrary to Safferling’s post I’ll try to also (1) look at packages from previous years that hit the big league, (2) what top R coders we have in the community, and then (2) round-up with my own 2015-R-experience. Continue reading

Flattr this!

Posted in R | 4 Comments

Cuff surgery: Still no cigar

The degenerative cuff tear still unresolved. The image is CC by Brian
The degenerative cuff tear still unresolved. The image is CC by Brian

I’ve previously reported on Kukkonen et al’s excellent three-armed rotator cuff surgery RCT. They’ve now just published the 2-year follow-up where they still don’t see any difference in outcomes. Interestingly, they’ve added an MRI and noted that the cuff tear remains smaller among those that had surgery. This indicates that the intended surgery works but still too early to see any actual results. Continue reading

Flattr this!

Posted in Orthopaedic surgery | Leave a comment

Canakinumab – difficult to pronounce but useful for treating gout?

Gout onset is sudden and be intensely painful. The image is CC by Mike
Gout onset is sudden and be intensely painful. The image is CC by Mike

Gout can be incredibly painful where the main treatment option are nonsteroidal anti-inflammatory drugs (NSAID). Unfortunately NSAIDs are not the best alternative for elderly patients as it may induce heart & kidney failure. I was therefore thrilled to see that canakinumab recently was approved by Läkemedelsverket as a treatment alternative. Continue reading

Flattr this!

Posted in General, Orthopaedic surgery, Research | Leave a comment