How to create and plot a swiss roll using sklearn

Crystal X
Geek Culture
Published in
4 min readSep 16, 2021

--

In my last video I discussed how to create a s curve and plot it on a graph (as well as make predictions on it). The link to that post can be found here:- https://medium.com/geekculture/how-to-make-and-plot-a-s-curve-using-sklearn-17c98ddbeb4d

In this post I intend to discuss how to use Python’s machine learning library to create a swiss roll, plot it on a graph, and make predictions on it.

Both the s curve and swiss roll are part of sklearn’s manifold datasets. Manifold learning is an approach to non-linear dimensionality reduction. Algorithms for this task are based on the idea that the dimensionality of many data sets is only artificially high.

I have written the script where I created the swiss roll in Google Colab, which is a free online Jupyter Notebook that is available for anybody who has a computer, internet connection and search engine. There are other Jupyter Notebooks that can be used, such as Microsoft Azure and Saturn Cloud, but these platforms are not free. Because money is tight, I prefer to use free resources whenever possible. The only real drawback that I can see is the fact that Google Colab does not have an undo function, so care needs to be taken not to overwrite or delete valuable code. There is a function in Google Colab’s file menu called playground function, and this allows people to…

--

--

Crystal X
Geek Culture

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.