loading libsvm text file in scikit - scipy

I have a text file called "test.txt" which contains data in libsvm format.
Data in this file is represented as follows:
165475 0:246870 1124384:2 342593:7 1141651:1 297582:1 1186846:1 17725:1 656602:1
463304:1 766612:1 573309:1 290046:1 748198:1 216665:1 950594:2 909004:1 29008:1
105623:1 5018:5 806027:1 1125729:1 757846:1 1023921:2 612980:1 120767:1 51340:1
108172:5 674420:2
where 1st term represents the label and remaining represents the feature and its weight(separated by : ).This is a very huge file(with every label having lots of features and weights).
I am using scikit with ipython notebook and want to load this data in notebook to start processing it.
Can someone tell how to do that.Thanks in advance.

Use load_svmlight_file from sklearn.datasets.

Related

How to use Transfer Learning for Text classification in Apples Create ML?

I was watching https://developer.apple.com/videos/play/wwdc2019/428/, where Transfer Learning is used for text classification in Create ML.
I wanted to do the same and created Datasets with the following structure:
Folders where the Name of the Folder is the Label / Answer to a Question.
Inside each folder there are 10 text files with Questions.
Pretty much the same Idea like in the Video.
When I now choose Transfer Learning (like in the Video) and start to train, the Window tells me "Model has no Data" (see Screenshot).
Error Screenshot
What I am doing wrong ?
By looking at your Error Screenshot, you are missing the test data.

Plot3D Reader Sample Data

Is there a place to find sample CFD data in this format please?
I am trying to create scripts for Paraview to automate files opening and want to use the track function.
Data from this article can be used to test out the file format:

Read Biopax file in matlab

How can we read Biopax file in matlab, biopax is special type of xml file. How we can retrieve information from it using matlab.
There is a BioConductor package for reading and manipulating BioPAX files in R (http://bioconductor.org/packages/release/bioc/html/paxtoolsr.html).
Check out the related tutorial on getting set up in R:
https://www.youtube.com/channel/UCWSbcyynroIp-f6O3sfz7jg
AND using PaxtoolsR:
http://bioconductor.org/packages/release/bioc/vignettes/paxtoolsr/inst/doc/using_paxtoolsr.html

dicomrt2matlab - how to load data after conversion

I am using the program dicomrt2matlab. I was able to convert the dicom RT structure into matlab and I got the .mat file as well. How do I load the .mat file into matlab next? How can I see the RT information in my applied to my dicom files ?
Link - https://github.com/ulrikls/dicomrt2matlab
if you do data=load('myfilename.mat'); data will contain everything on it.
It shoudl have (I think) the following 3 data on it: 'contours', 'rtssheader', 'imageheaders'
you can access it as data.imageheaders

Open .mat file in matlab or unix - new user

I am going through someone's data analysis files (created in an older version of matlab) and trying to find out what a particular .mat file is that was used in a matlab script.
I am trying to load a .mat file in matlab. I want to see what is in it.
When I type...
load ('file.mat')
the file loads and I see two variables appear in the workspace. jobhelp and jobs.
When I try to open jobs by typing the following in the matlab command window...
jobs
the response is..
jobs =
[1x1 struct]
Does this mean that there is only a 1 x 1 structure in the .mat file? If so, how in the world do I see what it is? I'm even happy to load it in unix, but I don't know how to do that either. Any help would be greatly appreciated as I have a few files like this that I can't get any information from.
Again, a new user, so please make it simple.
Thanks
It means that jobs is a cell array {} and within this cell array is a structure defined
To see the structure and its contents type jobs{1}
I think you are dealing with a SPM5 Batch-File. This variable is an image of the tree-like structure you can see in the Batch-Editor of SPM. Your job consists of one subitem (stats) which could have various subsubitems (like fMRI model specification, model estimation and so on).
To access this structure on the command line just proceed like Nick said:
Each level is a separate cell array that you can access with {#} after the name of the level. Example: jobs{1} shows you that there is a subitem named stats.
Subitems in structs are accessed with a dot. Example: jobes{1}.stats{1} shows you the subitems of the stats-entry.
Notice that there could be more than one entry on each layer: A stats module could (and probably would) contain various subitems. You can access them via jobs{1}.stat{2}, jobs{1}.stats{3} and so on.
The last layer would be the interesting one for you: The structures in here is an image of the options you can choose in the batch-editor.