Pyshac

Latest version: v0.3.5.1

Safety actively analyzes 685838 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 2

0.3.1

Changelog

- Added support for Callbacks. `History` and `CSVLogger` are the first available.
- `History` callback is now returned for all `shac.fit(...)` and `shac.fit_dataset(...)` calls.

Example
python
from pyshac.config.callbacks import History, CSVLogger

shac = SHAC(...)

History is not needed here, as it is automatically added by default for all .fit / .fit_dataset calls.
callbacks = [History(), CSVLogger('path/to/file.csv')]

history = shac.fit(evaluation_function, callbacks=callbacks)
OR
history = shac.fit_dataset('path/to/dataset', callbacks=callbacks)

print(history.history)

0.3.0.5

Changelog:

- Add dataset visualization support for trained engines.

python
from pyshac.utils.vis_utils import plot_dataset

shac = pyshac.SHAC(...)
shac.fit(...) or shac.fit_dataset(...)

plot_dataset(shac.dataset, to_file='dataset.png', title='Dataset history', eval_label='Loss')


- Add **fit_dataset**, which supports engine fitting on external datasets

Uses the provided dataset file to train the engine, instead of using the sequentual halving and classification algorithm directly. The data provided in the path must strictly follow the format of the dataset maintained by the engine.

**Standard format of datasets:**

Each dataset csv file must contain an integer id column named "id"
as its 1st column, followed by several columns describing the values
taken by the hyper parameters, and the final column must be for
the the objective criterion, and *must* be named "scores".

The csv file *must* contain a header, following the above format.


Example
python

params corresponds to params in the external dataset
total_budget is <= the size of the external dataset
num batches is set such that total budget is divisible by num batches

shac = pyshac.SHAC(params, total_budget, num_batches)

shac.fit_dataset('path/to/external/dataset.csv', presort=True)


Bugfixes:

- Properly add the readme to Pypi
- Use codecs for writing compatibility
- Use io for reading compatibility

0.3.0

0.2.1

Changelog :

- Add `get_best_parameters` method in Dataset. Can be used to obtain the parameters which either maximize or minimize the objective score.

python
shac = SHAC(...)
shac.fit(...)

best_parameters = shac.dataset.get_best_parameters(objective='max')

0.2.0

Changelog :

- Improvements to the `fit` api and speed improvements to `predict`.
- Use `joblib 0.12` and `loky` to avoid the if __name__ == '__main__' blocks for Windows OS.
- Cleaned the `fit()` api to take the eval function as an argument instead of class variable.
- Improve the api for predict to grant more flexibility
- Now allows prediction of single samples, batches or combinations of both.
- Improve speed of sampling when using `predict()`.
- Upgraded the managed backends to new api

0.1.0

Initial release

Page 2 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.