skchem.data.BursiAmes.available_sets()

"""
Explanation: Data
scikit-chem provides a simple interface to chemical datasets, and a framework for constructing these datasets.  The data module uses fuel to make complex out of memory iterative functionality straightforward (see the fuel documentation).  It also offers an abstraction to allow easy loading of smaller datasets, that can fit in memory.  
In memory datasets
Datasets consist of sets and sources.  Simply put, sets are collections of molecules in the dataset, and sources are types of data relating to these molecules.
For demonstration purposes, we will use the Bursi Ames dataset.  This has 3 sets:
End of explanation
"""


skchem.data.BursiAmes.available_sources()

"""
Explanation: And many sources:
End of explanation
"""


kws = {'sets': ('train', 'valid', 'test'), 'sources':('X_morg', 'y')}

(X_train, y_train), (X_valid, y_valid), (X_test, y_test) = skchem.data.BursiAmes.load_data(**kws)

"""
Explanation: For this example, we will load the X_morg and the y sources for all the sets.  These are circular fingerprints, and the target labels (in this case, whether the molecule was a mutagen).
We can load the data for requested sets and sources using the in memory API:
End of explanation
"""


print('train shapes:', X_train.shape, y_train.shape)
print('valid shapes:', X_valid.shape, y_valid.shape)
print('test shapes:', X_test.shape, y_test.shape)

"""
Explanation: The requested data is loaded as nested tuples, sorted first by set, and then by source, which can easily be unpacked as above.
End of explanation
"""


X_train

y_train

"""
Explanation: The raw data is loaded as numpy arrays:
End of explanation
"""


skchem.data.BursiAmes.read_frame('feats/X_morg')

"""
Explanation: Which should be ready to use as fuel for modelling!
Data as pandas objects
The data is originally saved as pandas objects, and can be retrieved as such using the read_frame class method.  
Features are available under the 'feats' namespace:
End of explanation
"""


skchem.data.BursiAmes.read_frame('targets/y')

"""
Explanation: Target variables under 'targets':
End of explanation
"""


skchem.data.BursiAmes.read_frame('indices/train')

"""
Explanation: Set membership masks under 'indices':
End of explanation
"""


skchem.data.BursiAmes.read_frame('structure')

"""
Explanation: Finally, molecules are accessible via 'structure':
End of explanation
"""


