-3

I have around 700 .mat files saved in my PC (64-bit, Windows 8 OS), and these files contain matlab structures containing matrices, and other information about them like eigenvalues etc. I produced these files by running some matlab codes.

Now, I'm newly learning scikit-learn, and I'd like to import the .mat files onto my Jupyter notebook, and would like to perform machine learning in scikit-learn (not in matlab) on the matrices saved in the above mentioned .mat files.

  1. How can I do this import onto Jupyter?

  2. Also, the matrices above are probably saved in matlab array format. How can I transform them into numpy arrays to make them ready for scikit-learn use?

I'm very new to Jupyter and Python in general, so I'd greatly appreciate a step by step instruction if you could.

Martin Evans
  • 45,791
  • 17
  • 81
  • 97

1 Answers1

-2

As long as I know you should convert everything to python (read: do all the work all over again) but Jupyter should support also R-notebooks. So if you just want to have a notebook you can convert your data from matlab to R (see: https://stat.ethz.ch/pipermail/r-help/2008-March/158144.html) and then create it.

Hope it could be useful, if not I am sorry. Best luck!

PrisonGuy
  • 15
  • 4
  • thanks for your answer. Sorry I don't know R at all, and would like to do the ML in Python only. Is there a way to convert a .mat file into a Python file to use it into Jupyter? – Noprogexprnce mathmtcn Apr 13 '17 at 11:27
  • 1
    Maybe it could be a stupid anwer from me because you probably already googled it but isn't this working? http://stackoverflow.com/questions/874461/read-mat-files-in-python – PrisonGuy Apr 13 '17 at 11:37