Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPython Notebook for HessianLLE. #3540

Closed
wants to merge 2 commits into from
Closed

IPython Notebook for HessianLLE. #3540

wants to merge 2 commits into from

Conversation

sudk1896
Copy link

This addresses the #2674
This notebook is a SHOGUN analog of the scikit tutorial given here. Note that I have included the tutorial only for one of the manifold learning methods i.e. Hessian LLE. More would be included once this is reviewed better.
The output of the notebook (along with the plot, of course) is here.
@karlnapf Review.

@karlnapf
Copy link
Member

I think we should put the content into the existing notebook

Copy link
Member

@karlnapf karlnapf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I have to say that the exaples in scikits notebook look much cooler than the plot here ;)
Can we have something similar?

"from mpl_toolkits.mplot3d import Axes3D\n",
"\n",
"\n",
"mat = loadmat('usps.mat')\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to make sure this works when executed from its folde ron our servers. See the other notebooks for the relative path of the usps data

{
"cells": [
{
"cell_type": "code",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than putting all content into a single cell, split it into multiple ones.
Then dont use source code comments to explain what you are doing, but the notebook markdown in separate cells

"#print Xall_.shape\n",
"Yall = np.array(mat['label'].squeeze(), dtype=np.double)\n",
"Yall_ = np.resize(Yall, (1024, ))\n",
"def plot(data, embedded_data, colors='m'):\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please define functions in their own cells
Also give every function a proper name, and put a minimal docstring

"Xall_ = np.resize(Xall, (256, 1024))\n",
"#The number of training examples have been reduced to make it feasible to run.\n",
"\n",
"#print Xall_\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please no commented out code in patches

"\tplt.axis('tight'); plt.axis('off')\n",
"\tplt.show()\n",
"\n",
"from modshogun import StochasticProximityEmbedding, RealFeatures, HessianLocallyLinearEmbedding\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls do
import modshogun as sg and do all imports in a single cell

"\n",
"#print converter.get_reconstruction_shift()\n",
"\n",
"plot(data, embedded_data, colors)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every plot needs a title and axis labels.
In addition, it should have some description of what we can see

Copy link
Member

@karlnapf karlnapf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that, I made some comments

@karlnapf
Copy link
Member

ill close for now, feel free to reopen if you have updates

@karlnapf karlnapf closed this Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants