Closed sbhakat closed 5 years ago
I am not using the MSMBuilder dataset object here. you will need to first generate that dataset for the tica_features before the code will work as you have it written. Alternatively, the following modification should work.
tica_mdl = tICA(lag_time=100,n_components=ncomp, kinetic_mapping=False)
tica_features = tICA.fit_transform(train_feat)
verbosedump(tica_mdl,"tica_mdl.pkl")
verbosedump(tica_features,"tica_features.pkl")
getting an error like
TypeError: fit_transform() missing 1 required positional argument: 'sequences'
This should work, i am guessing I make train_feat a dictionary instead of a list of lists.
tica_features = tICA.fit_transform(list(train_feat.values())
Well it can't be tICA
tica_mdl = tICA(lag_time=100,n_components=4, kinetic_mapping=False)
tica_features = tICA.fit_transform(list(train_feat.values())
#verbosedump(tica_mdl,"tica_mdl.pkl")
verbosedump(tica_features,"tica_features.pkl")
We defined tica_mdl but not using it during fit_transform that seems wired or am I misunderstanding the process?
After that I am getting an error like:
File "<ipython-input-51-01cfb022b000>", line 11
verbosedump(tica_features,"tica_features.pkl")
^
SyntaxError: invalid syntax
Attaching my notebook for more reference. bhakat_method.pdf
whoops, my bad, that should have been:
tica_features = tica_mdl.fit_transform(list(train_feat.values())
The verbose dump syntax problem still persists
from msmbuilder.io import load_trajs, save_trajs, save_generic
from msmbuilder.io.sampling import sample_dimension
from msmbuilder.io import load_trajs, save_generic, preload_top, backup
from msmbuilder.utils import dump
%matplotlib inline
tica_mdl = tICA(lag_time=100,n_components=2, kinetic_mapping=False)
tica_features = tica_mdl.fit_transform(list(train_feat.values())
#verbosedump(tica_mdl,"tica_mdl.pkl")
verbosedump(tica_mdl,"tica_mdl_rawpos.pkl")
It still gives an error like
File "<ipython-input-63-e51343b3e9e5>", line 11
verbosedump(tica_mdl,"tica_mdl_rawpos.pkl")
^
SyntaxError: invalid syntax
Not sure why is this?
tica_features = tica_mdl.fit_transform(list(train_feat.values()) that line is missing a ) at the end. thats a python syntax error.
AttributeError Traceback (most recent call last)
wait, is train_feat already a list? try printing out its type in an ipython shell. my guess is that you need to remove ".values()"
Got it. Thanks
I was trying to perform tICA using the features.pkl which was described in this notebook
https://github.com/msultan/SML_CV/blob/master/alanine_example/01-svm_example.ipynb
My steps looks like:
It gives an error
TypeError: 'list' object is not callable
Am i doing something wrong?