Repository navigation
Fcma partial sim matrix - #168
Conversation
| assuming all elements of X has the same num_voxels value | ||
| y: labels, len(X) equals len(Y) | ||
| num_training_samples: int, default None | ||
| the number of samples that used in the training, |
| The number of samples of the training set | ||
|
|
||
| num_digits_: int | ||
| The number of digit of the first value of the kernel matrix, |
| Used for SVM with precomputed kernel, | ||
| every time only compute correlation between num_process_voxels and | ||
| the whole brain to aggregate the kernel matrices. | ||
| This is to better use the memory |
There was a problem hiding this comment.
You mean to save memory? Also, please write sentences in docstrings, including full stops and all other punctuation.
There was a problem hiding this comment.
yes, computing similarity matrices portion by portion can save the memory so as to handle correlations at a larger scale.
| @@ -57,7 +63,10 @@ class Classifier(BaseEstimator): | |||
| default None | |||
There was a problem hiding this comment.
Attributes are not set during initialization. They are not None.
| in which case training data is needed to compute | ||
| the similarity vector for each sample to be classified | ||
| the similarity vector for each sample to be classified. | ||
| However, if the test samples are also provided during the fit, |
There was a problem hiding this comment.
Please add a paragraph at the beginning of the docstring explaining how testing data can be passed to fit as an optimization.
| subsequent operations, e.g. getting decision values of the prediction | ||
| subsequent operations, e.g. getting decision values of the prediction. | ||
| test_data\_ may also be set in the fit method | ||
| if SVM.SVC with precomputed kernel and the test samples are known. |
There was a problem hiding this comment.
Use the full package name in docstrings for modules outside BrainIAK, i.e., sklearn.svm.SVC.
| assuming all elements of X has the same num_voxels value | ||
| start_voxel: int, default 0 | ||
| the starting voxel id for correlation computation | ||
| num_voxels_1: int, default None |
| which is set when the similarity matrix is constructed | ||
| portion by portion so the similarity vectors of the | ||
| test data have to be computed here. | ||
| If it is set, only those samples will be used to fit the model |
There was a problem hiding this comment.
Document also that this only applies to SVMs with precomputed kernels, where it must be present.
|
|
||
| def example_of_aggregating_sim_matrix(raw_data, labels): | ||
| # aggregate the similarity matrix to save memory | ||
| use_clf = svm.SVC(kernel='precomputed', shrinking=False, C=1) |
There was a problem hiding this comment.
use_clf seems like a Boolean name. How about svm_clf?
add partial similarity matrix algorithm in correlation-based classification
add the corresponding test code
rename some methods
improve the example code