Estimating device height from 3-axis accelerometer data (possibly by supervised learning) I'm trying to estimate the height of my device using an cheap integrated Freescale accelerometer.

First, I estimate the earth direction when measured acceleration is close to 1g, then I project the measurement on that direction and integrate twice.
Very quickly the estimated height drifts.

I was thinking maybe to use some machine learning algorithm, by feeding it aligned height from video tracking as examples.

Can you suggest algorithms that would help doing that?
Or any other way to make height estimation more precise?

Edit: Motion is known to be limited in a range of ±0.5m.
Any tiny offset error will cause a double integration to fly off quadratically in time.  Even if you manage to calibrate out this error for one sample test setup, any drift in offset due to change in temperature, orientation, age, power fluctuations, etc., will eventually render that calibration useless.

Continuous recalibration (airspeed, compass, optical fix, etc.) is likely required for a more useful result over a sufficiently long time period.