Machine Learning/Analytics on Blockchian?


I believe that there is potential in implementing analytics into the blockchain, as we could gain better insight on the current state of the blockchain. However, theres one major hiccup in regards to this: Because blocks are hashed, it would be nearly impossible to conduct analysis without compromising security.

Do you guys have any ideas on how we could implement this?
And if this is impossible, theoretically, how could we incorporate analytics into blockchain?