Skip to main content

Optimization of hyperparameters for Machine Learning (AI)

Project description

Introduction to Opptimizer

Opptimizer is an optimization framework designed for AI pipelines, enabling efficient management and execution of complex processes and workflows.

This section provides a quick overview of installation, basic usage, and simple examples.
To dive deeper, please see the full documentation at https://opptimizer.readthedocs.io/.

Installation

Installin by PyPI is appropriate for most use cases.

pip install opptimizer

There is also advanced way of local install described here.

Basic Usage

1. Import the opptimizer Library

Begin by importing the opptimizer library into your project:

import opptimizer

2. Create an Executor Instance

Create an instance of the Executor class. You can optionally set the context and/or specify a configuration file containing the context during instantiation:

executor = opptimizer.Executor(context=my_context)
# or with a configuration file (you can use any file name)
executor = opptimizer.Executor(cfg="path/to/opp.cfg")

3. Define Modules

Define the modules you intend to use. Modules can be function:

def module_exec(mod_obj, params, tokenData):
    # Process tokenData
    return tokenData

or instances of the Mod class:

module_instance = opptimizer.Mod(module_exec)

4. Run the Executor.run() Method

Run the Executor with input data or a list of modules:

result = executor.run(input_data,modules=[module_exec])

or with an module instance:

result = executor.run(input_data, modules=[module_instance])

You can use any number of modules in modules list that will be executed sequentially.

5. Get the Result from Execution

Retrieve the result from the execution:

final_result = result.get_result()

Examples of Usage

Basic Pipeline Example

The following example demonstrates a simple pipeline that extends an input string by adding additional parts through modules mod_1 and mod_2, ultimately returning the combined text.

import opptimizer as op

def mod_1(mod_obj, params, tokenData = None):
    tokenData = tokenData + 'result 1'
    return tokenData

def mod_2(mod_obj, params, tokenData = None):
    tokenData = tokenData + ', result 2'
    mod_obj.setResult(tokenData)

executor = op.Executor(modules = [mod_1, mod_2])
response = executor.run('Results: ')

print(f"{response.get_result()}")
Output:
    Results: result 1, result 2

License

This project is licensed under the Apache License 2.0. You may use, modify, and distribute this software freely, provided that you comply with the terms of the license, which include attribution and a disclaimer of warranties. For the full license text, please see Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opptimizer-2.3.7.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

opptimizer-2.3.7-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file opptimizer-2.3.7.tar.gz.

File metadata

  • Download URL: opptimizer-2.3.7.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.4.0

File hashes

Hashes for opptimizer-2.3.7.tar.gz
Algorithm Hash digest
SHA256 f3296824e71bfb194e5b5b11207d1c7cd555bba10b419adf395ebd3f53efc4a2
MD5 b3dc93ea094862e9be728a909db0f075
BLAKE2b-256 0ef97275f3ca6d714bffa0e08d06aa46432b1bad077662c0c901c909f490485d

See more details on using hashes here.

File details

Details for the file opptimizer-2.3.7-py3-none-any.whl.

File metadata

  • Download URL: opptimizer-2.3.7-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.4.0

File hashes

Hashes for opptimizer-2.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b1d02a1bbd89ec1afa171289e64f91e5f8fc8d8eae0a904709e5ae96804892bb
MD5 c79c76109c8a8f091cae3bf47c59ce95
BLAKE2b-256 82b72da063da8f5dc8a3989b136bd685c4bf4f501f4043742eef30e5b9dd7db3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page