So far I have resourced another post and sklearn documentation So in general I want to produce the following example: …