-
Notifications
You must be signed in to change notification settings - Fork 0
initial commit #263
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
base: master
Are you sure you want to change the base?
initial commit #263
Conversation
Codecov Report
@@ Coverage Diff @@
## master #263 +/- ##
=========================================
- Coverage 6.54% 6.37% -0.17%
=========================================
Files 19 20 +1
Lines 688 706 +18
=========================================
Hits 45 45
- Misses 643 661 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Farnazmdi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I strongly recommend running figure1 first (make output/figure1.svg) and taking a look at the plots to see where we are at.
Then you can use figure 1e to see how many components to use for PCA.
As I mentioned below, please write your scores and loadings plot function in the plotHelpers.py.
After these, we will focus on what to annotate and what to plot to see the repeating patterns.
| def R2X_plot(datafile): | ||
| R2X_list = [] | ||
| data = StandardScaler().Tensor_LINCS_MEMA(data) | ||
| for x in range(2, 21): | ||
| PCA_model = PCA(n_components=x) | ||
| PCA_model.fit(data) | ||
| R2X_list.append(np.sum(PCA_model.explained_variance_ratio_) * 100) | ||
| plt.plot(range(2, 21), R2X_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to write an R2X function. You can use the one from tensorpack (take a look at figure1 to see how to use it.) I believe we don't need an R2X plot. Just run it for yourself to decide how many components you want. Although, you can decide from the reduction plot, too (figure1e).
| def scores_plot(datafile): | ||
| data = StandardScaler().Tensor_LINCS_MEMA(datafile) | ||
| PCA_model = PCA(n_components=2) | ||
| pca_scores = PCA_model.fit_transform(data) | ||
| plt.scatter(pca_scores[:,0], pca_scores[:,1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can write the scores and loadings plot in the plotHelpers.py file.
| @@ -0,0 +1,24 @@ | |||
| """Contains function for performing PCA on OHSU data""" | |||
| from dataHelpers import Tensor_LINCS_MEMA | |||
| from sklearn.preprocessing import StandardScaler | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the data has already been normalized in the importing function, so you don't need to do it again.
|
@aryakrekhi please do |
|
Please do |
No description provided.