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

Fcma classification #122

Merged
merged 20 commits into from Sep 30, 2016
Merged

Fcma classification #122

merged 20 commits into from Sep 30, 2016

Conversation

@yidawang
Copy link
Member

@yidawang yidawang commented Sep 29, 2016

  1. add correlation-based classification of FCMA
  2. restructure the example code of FCMA
  3. fix minor typos
Parameters
----------
X: a list of numpy array in shape [nun_TRs, num_voxels]

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

Typo, num_TRs

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

Parameters
----------
X: a list of numpy array in shape [nun_TRs, num_voxels]
len(X) equals num_test_samples

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

As far as I understand, you are defining the variable num_test_samples here in the docstring. This is confusing. Use len(X) in this docstring, not num_test_samples.

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

epochs_per_subj=0):
self.clf = clf
self.epochs_per_subj = epochs_per_subj
self.training_data = None

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

Only set parameters passed to __init__. So do not set training_data, num_voxels, and num_samples. If you are thinking about it, do not add them as parameters to __init__, because they are data dependent. See the scikti-learn documentation:
http://scikit-learn.org/stable/developers/contributing.html#instantiation

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

num_samples = len(X)
num_voxels = X[0].shape[1] # see assumption above
self.num_voxels = num_voxels
self.num_samples = num_samples

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

You should add an _ to attributes set based on the data:
http://scikit-learn.org/stable/developers/contributing.html#estimated-attributes

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

len(X) equals num_test_samples
if num_test_samples > 0: normalization is done
on all test samples
num_voxels equals the one used in the model

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

self.num_voxels_?

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

""" use a trained model to predict correlation data
the input data X is activity data filtered by top voxels
and prepared for correlation computation.

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

Move this explanation to the definition of X below.

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

X needs to be first converted to correlation,
and then normalized across all samples in the list
if len(X) > 1,
and then predicted via self.clf.

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

If this is the description of what the method does, change to phrasing from "needs to be" to "is".

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

create_epoch(), create_epoch(),
create_epoch(), create_epoch(),
create_epoch(), create_epoch(),
create_epoch(), create_epoch()]

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

How about [create_epoch() for i in range(20)]?

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

Copy link
Member Author

@yidawang yidawang left a comment

thanks for the review

Parameters
----------
X: a list of numpy array in shape [nun_TRs, num_voxels]

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

""" use a trained model to predict correlation data
the input data X is activity data filtered by top voxels
and prepared for correlation computation.

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

X needs to be first converted to correlation,
and then normalized across all samples in the list
if len(X) > 1,
and then predicted via self.clf.

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

Parameters
----------
X: a list of numpy array in shape [nun_TRs, num_voxels]
len(X) equals num_test_samples

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

len(X) equals num_test_samples
if num_test_samples > 0: normalization is done
on all test samples
num_voxels equals the one used in the model

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

create_epoch(), create_epoch(),
create_epoch(), create_epoch(),
create_epoch(), create_epoch(),
create_epoch(), create_epoch()]

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

num_samples = len(X)
num_voxels = X[0].shape[1] # see assumption above
self.num_voxels = num_voxels
self.num_samples = num_samples

This comment has been minimized.

@yidawang

yidawang Sep 29, 2016
Author Member

done

Parameters
----------
X: a list of numpy array in shape [num_TRs, num_voxels]

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

How about self.num_voxels_? Then you can also remove the last line below.


logger = logging.getLogger(__name__)

def readActivityData(dir, file_extension, mask_file):

This comment has been minimized.

@mihaic

mihaic Sep 29, 2016
Contributor

PEP 8 names, please.

@mihaic
mihaic approved these changes Sep 30, 2016
@mihaic mihaic merged commit 33cc14b into brainiak:master Sep 30, 2016
3 checks passed
3 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
linux Build finished.
Details
macos Build finished.
Details
@yidawang yidawang deleted the yidawang:fcma_classification branch Sep 30, 2016
danielsuo pushed a commit that referenced this pull request Nov 16, 2017
* Ignore /build directory

* Some Windows and Visual Studio .gitignores
danielsuo pushed a commit that referenced this pull request Nov 16, 2017
* First attempt at fixing psubscribe. psubscribe_success_test will fail

* psubscribe test

* SUBSCRIBE returns the number of subscriptions, not success

* Comment out failing test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.