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(data):
    # Process data in some way
    return modified_data

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.3.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

opptimizer-2.3.3-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opptimizer-2.3.3.tar.gz
  • Upload date:
  • Size: 31.4 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.3.tar.gz
Algorithm Hash digest
SHA256 208445b3567a600f6d52f651734d78a866f3da33f16e97e0e9178c7f2363e063
MD5 1032d6c981f5e015ae3aad84739d7ae8
BLAKE2b-256 c5c3cc6ac9c8023f564eb75e877055c79f4f087f76864abc15240de178e9dd21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opptimizer-2.3.3-py3-none-any.whl
  • Upload date:
  • Size: 39.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1612c53546eccceaf2a7412929d53dea8eb82573ef90062ac989d978ec089db6
MD5 915dac8a0ac7769570c9e1085ce58a1b
BLAKE2b-256 fdf7f59b716e3a51c0087f8bb0b75fdaed42693913e04aa35ac06f12a644e5f6

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