Machine Learning using Python and TensorFlow

TensorFlow is an open source software library created by some very smart people at Google, and specifically designed for Machine Learning.

I recently started dipping my toes into Machine Learning, and (first and foremost) it is great fun, but it is also really fascinating what we can learn from data.

You can follow my exploration into Machine Learning, and hopefully you find something interesting to read along the way, and maybe even learn a thing or two along with me.

For now you can find an (almost empty, and not really interesting) GitHub repository with my code so far. My goal is for this to include some relevant resources and structure to some data stories incorporating Machine Learning, that I might be able to present on this site one day.

Topics might include everything from Random Forest, Neural Networks and even Data Mining.

Introducing Danstickers!

We are living in exciting times, everyone! I have created my first sticker pack for those of you who like all things Denmark. I promise they are a lot of fun!

Here is what I write about them on the iMessage App Store:

Danstickers is a pack of stickers incorporating all things Denmark. You ever wished you had the chance to send your friend that really pretty Danish flag inspired thumbs up? Or maybe a sticker of our lovely Little Mermaid? Now you have the chance.

If you’re are curious about the National Dish of Denmark (as of 2014), you can download the sticker pack and it will give you the answer! So what are you waiting for?

Please check them out and let me know if you have any suggestion for fun stickers you wish, you could send to your friends!

Get your new favourite sticker pack today!

Getting data into Apple Health

Apple Health appApple Health is key in my Quantified Self workflows. I generate a lot of data about me and my health, which is all logged and stored safely in the Apple Health app on my iPhone 6s.

On a regular day I track 20+ different things in the Apple Health app. The most interesting ones being steps, walking + running distance, active energy, resting energy, sleep, dietary energy, body fat percentage, weight, BMI, and heart rate.

All these things are tracked through a small set of apps and devices, that each play an essential part in my workflow. Let’s take a look at these one by one.

The first device is my Apple Watch. I own a Apple Watch 1st generation, which I’m wearing day and night. During the day it automatically tracks my steps, walking distance, resting and active energy, heart rate and stuff like exercise minutes, stand hours and stairs climbed. The latter I’m not too concerned about, since especially exercise minutes seems to way to generous in deciding what counts as exercise. Riding my bike through the streets of Copenhagen, stopping at every traffic light, does not count as exercise in my book.

I used to wear a dedicated step tracker, and although it was a cheaper model, I believe it was pretty accurate. In a few tests it seems like my Apple Watch does a pretty good job at following the old step tracker, so I choose to believe that it is fairly accurate in regards to tracking steps.

During the night I use my Apple Watch to track the hours I sleep. I have played around with the iPhone’s Bedtime feature (which you can find it in the Clock app), but I tend to go to bed a different time every night, which the Bedtime feature doesn’t allow for. Therefore I chose to take a look at the App Store to find an alternative way to track my sleep. I stumbled upon an app called Sleep++ (created by David Smith) which essentially is an Apple Watch app that magically tracks your sleep quality by tracking your arm and wrist movement during the night. The only downside to this app is, that you have to activate it yourself. If you forget this, you’ll lose a night’s worth of data. I have made it a habit to always turn on the sleep tracking (from my dedicated sleeping Watch Face) when I lie down in bed, but I do occasionally forget it anyway.

The data from the app seems pretty reliable. It differentiates awake, restful and restless sleep, and it even tries to let you know when you had your best minutes (or hours of sleep during the night). Only the time in bed and time asleep is recorded into the Health app, but I find this sufficient. If I need a more detailed look at the nights I sleep, I can always open the iOS version of the app, that contains all the history.

Finally, I use my Apple Watch for tracking exercise. I use the built in Apple Watch Training app for the average day running and rowing in the local gym. The data isn’t as accurate as wearing a dedicated heart rate monitor, but I find it sufficient for those types of quick workouts. The convenience of having it automatically recorded in the Health app is golden.

I do own a dedicated GPS sports watch, namely the Garmin Forerunner 910XT and the accompanying heart rate strap. It is by no means a new model, but it gets the job done at my more serious outdoor exercise sessions (typically running or cycling). My workflow for logging data collected on the Garmin watch is a bit more involved. After logging the data I import it manually to my Mac (newer Garmin models can upload directly through your phone). Once it is inside the Garmin ecosystem, I export it to Endomondo, which I like to use for my more serious workouts anyway. Then, using a great iOS app called RunGap, I transfer the data from Endomondo into Apple Health with a single tap.

Withings Smart Body Analyzer

Moving on, the next device I use is the Smart Body Analyzer Scale from Withings. The scale connects to my home wifi and comes with an app for you iPhone. It lets me easily log my weight, body fat percentage, and BMI into the Health App every day. All I have to do is step on the scale in the morning.

Coming soon: Full review of the Withings Smart Body Analyser Scale.

As an added benefit it even measures the air quality in the room. I keep mine in my bedroom, and every morning when I step up on it, it’ll tell me what the CO2 levels were the last 24 hours (and hence if it is about time to open a window).

Finally, the last part of my workflow for logging data into the Apple Health app involves food logging. I use the iOS app Lifesum to log my food intake. It has a nicely sized database (at least when it comes to products sold in Denmark. I can’t say how many US and/or UK only products are stored in their database, but I believe it should have a pretty good coverage). You can scan the barcode on a given product and it will automatically find the right entry for you and suggest the amount to enter based on normal serving sizes of that specific type of food.

The most important thing about Lifesum is, that it automatically syncs your entries into the Health app logging both the bigger things like calorie intake, protein, fat, and carbohydrates, but also smaller things like fibers, sodium etc., which is nice to have, although I tend to focus very little on these.

Coming soon: Full review of Lifesum for iOS – the best app for logging your food intake fast and reliably.

So to sum up, using just my Apple Watch, iPhone, and the Withings Smart Body Analyzer Scale, I can log 20+ things in the Apple Watch Health app, which I can then analyze to gain knowledge about my health. More on how I go about doing that will follow – so stay tuned!

Eksamenslæsning (og overspringshandlinger)

Forklaring af billedet: 1. november er en fridag i staten Victoria på grund af Melbourne Cup Carnival, der er et hestevæddeløb, der finder sted på Flemington travbane(?). Helt enkelt handler det om, at australiere tager meget fint tøj på og drikker sig rigtig fulde, mens de smider alle deres penge væk i forsøget på at gætte, hvilken hest der løber hurtigst. Jeg tog derud og deltog i arrangementet (dog uden at smide penge væk eller drikke mig fuld). Du kan se en video derfra nederst.

For ikke at give det indtryk, at hele min udveksling går op i rejser (der dog er sjovere at fortælle om), får I lige et lille indblik i sidste halvdel af mit semester, samt et overblik over mine kommende eksamener.

Oktober har stået på en masse afleveringer, der hver især har talt 10-20% af den samlede karakter. Det gør, at mine afsluttende eksaminer, som jeg har tre af, tæller mellem 70-80% af den samlede karakter.

Min første eksamen  (i Corporate Finance) lægger den 8. november, hvorefter jeg har to eksaminer den 10. november. De er allesammen skriftlige og dele af dem er multiple choice, der er dejligt nemt for en computer at rette (Melbourne University er endnu bedre til at spare penge på eksamen end Københavns Universitet), men virkelig irriterende for den studerende at gennemføre. De varer alle 3 timer, hvilket gør af jeg kan se frem til en dejlig lang torsdag 10. november, der starter med en eksamen i regnskab kl. 8:30 og slutter med stokastisk modellering fra kl. 13:15 til 16:15.

Så lige nu ser jeg bare frem mod at få overstået den 10. november. Min yndlings overspringshandling i disse dage er at kigge på ting man kan opleve langs Østkysten af Australien og i New Zealand. Jeg har nemlig købt flybilletter, der giver mig 4 ugers tid hvert af de to steder.

9.-12. sep: Great Ocean Road

Et (meget) forsinket opslag omhandlende vores road trip i anden weekend af september.

I og omkring weekenden 10.-11. september tog jeg sammen med mine housemates på road trip til Grampians nationalpark og Great Ocean Road, der ligger vest for Melbourne.

Vi kørte fra Melbourne fredag morgen og brugte fredag og lørdag på at hike i nationalparken. Lørdag aften kørte vi til Port Fairy, hvor Great Ocean Road starter. Søndag kørte vi den vestlige halvdel af den berømte vej, hvor vi blandt meget andet så de tolv apostle,  inden vi ankom til Apollo Bay, hvor vi tilbragte natten. Mandag kørte vi den resterende halvdel, hvor vejen snor sig langs kysten med havudsigt på den ene side og flot natur på den anden.

Vejret var desværre ikke med os på turen, hvilket også fremgår tydeligt af videoen.

Solnedgang fra Mt William. Det højeste punkt i Grampians National Park.
Solnedgang fra Mt William. Det højeste punkt i Grampians National Park.
De tolv apostle.
De tolv apostle.


Roning på Yarra River

Lidt video fra min kajaktur på Yarra River sammen med universitetets Mountaineering klub lørdag 27. august.

Resten af ugen står på forberedelse til mid-term eksaminer inden turen i weekenden går til Philip Island for at surfe.

Første måned på studiet

Den første måneds tid med undervisning er gået urimelig stærkt. Jeg har forsøgt at sammenfatte alt, jeg har lavet i løbet af august.

OL stemning i huset

Vi bor godt 15 personer (hvis man fratrækker kineserne, der holder sig for dem selv) fordelt på fire huse og ni lande: Danmark, Frankrig, Holland, Australien, Malaysia, Indonesien, Thailand, Storbritannien og USA.

Det har været rigtig sjovt at følge OL sammen med folk fra så mange forskellige lande. Særligt en vis håndboldkamp, der blev spillet kl. 3 om natten (til mandag), formåede at holde nogle i huset længe oppe 😀


Det har været rigtig rart at komme i gang med studiet, der har givet dagene/ugerne lidt mere struktur. Mit skema er således, at jeg reelt kun skal være på studiet onsdag og torsdag (hvilket jeg har tænkt mig at drage fordel af i hele september måned — se længere nede).

Undervisningsstrukturen på Melbourne Universitet er tilsvarende den i København. De forskellige fag består af forelæsninger og klasseundervisning (tutorials), men i modsætning til på KU, så er der mødepligt til tutorials, samtidig med at forelæsningerne optages og kan se hjemmefra. En anden markant forskel er at den endelige eksamen kun tæller 50-70% af den samlede karakter (alt afhængigt af faget), mens den resterende del kommer fra løbende vurderinger i form af aflevering, aktivitet i timerne o.l.

I Corporate Finance skal jeg f.eks. hver uge aflevere en opgave, der tæller 1% af min samlede karakter — nok til at man bliver nødt til at lave den (og skrive den rent — den skal afleveres håndskrevet..), men samtidig så lidt, at det virker åndssvagt. Heldigvis tager jeg faget sammen med en tysk pige, så de sidste par uger har vi sat os sammen og fået den ud af verden så hurtigt som muligt.

I de to andre fag arbejder jeg sammen med nogle australiere fra mit tutorial-hold.

De fem andre dage om ugen..

Der bliver også tid til andet end at studere 😏

I august har jeg fx været på cruise langs Yarra River, der løber lige igennem centrum i Melbourne. Jeg har været inde og se en AFL kamp, badet i havet (video), hiket på Mount Dandenong (video), været på barcrawl rundt på fire af Melbournes mest populære barer, spist en ugentlig middag med mine housemates, quizzet om olympisk paratviden på universitetet, spist Melbournes bedste taco’s og smagt Melbournes bedste margaritas.

Udsigt til Melbourne fra Brighton Beach. Taget kort efter jeg kom op af vandet.
En lille del af Melbourne skyline, som den så ud fra båden, da vi sejlede væk fra byen.
“Hollandske” pandekager til morgenmad. De minder nu meget om de danske!
Fuld koncentration under en konkurrence om at bygge det højeste tårn af kopper til OL Trivia aften.
Udsigt på vej op ad Mt Dandenong.

Planerne for september

De næste mange uger er også helt pakket. I morgen (lørdag) tager jeg med universitetets Mounteneering Club ud og roer kajak. I næste weekend er det med Surf klubben til Philip Island, der er kendt for fritgående pingviner og gode surferstrande. Øen ligger halvanden times kørsel syd for Melbourne, så vi har planlagt at leje en bil og gøre turen til en forlænget weekend. Selve surfcampen løber fra fredag til søndag, hvorefter vi bliver en ekstra dag eller to for at se resten øen.

Den efterfølgende weekend (10.-11. september) skal bruges på at køre (og hike) langs Great Ocean Road, og — hvis planen holder — så tager jeg weekenden efter igen (dvs. 17.-18. september) til Tasmanien.

Endelig slutter september af med vores “spring break”. Én god uges tid med Island hopping fra ø til ø på Fiji. Efter hvad jeg tror bliver en travl september, der forresten også inkluderer mid-terms eksaminer på studiet, bliver det rart at kunne slappe af på en lækker badestrand hvor de største beslutninger er, om man vil snorkle, ro eller have massage, og hvad man skal have i baren.