To be honest I find the division being improvisation and composed music to be mostly academic. I can spontaneously imagine a song, guitar part and play it spontaneously or I could grab a pen and paper and write it down. I guess I just see improvisation as spontaneous composition.
As the famous quote "Composition is just improvisation slowed down, and improvisation is just composition sped up." — Wayne Shorter or "Composing is a slowed-down improvisation; often one cannot write fast enough to keep up with the stream of ideas." Arnold Schoenberg
Ultimately the final recorded product whether it was produced by improvisation or composing can be after the fact notated down in a musical score even if it was not originally written that way. Ultimately he piece of music is judged by the notes on the page of the final product (along with the performance) whether the notes of the page was written in advance or not.