ATOMLoader
function atom.api.ATOMLoader(filename,
data=None, transform_data=True, verbose=None)
[source]
Load a class instance from a pickle file. If the file is a trainer that
was saved using save_data=False
, it is possible to load new data into
it. For atom pickles, all data transformations in the pipeline can be
applied to the loaded data.
Parameters: |
filename: str Tuple containing the features and target data. Only use this parameter if the file is a trainer that was saved using save_data=False (see
the save method). Allowed formats are:
Feature set with shape=(n_samples, n_features). If no y is provided, the last column is used as target. y: int, str or sequence
If False, the data is left as provided. If True, it is transformed
through all the steps in the instance's pipeline. This parameter is
ignored if the loaded file is not an atom pickle.
verbose: int or None, optional (default=None) |
Returns: |
cls: class instance Un-pickled instance. |
Example
from atom import ATOMClassifier, ATOMLoader
atom = ATOMClassifier(X, y)
atom.run("LR", metric="AP", n_calls=25, n_initial_points=10)
atom.save("atom", save_data=False) # Save atom to a pickle file
# Load the class and add the data to the new instance
atom_2 = ATOMLoader("atom", data=(X, y), verbose=0)