specparam.algorithms.algorithm.Algorithm

class specparam.algorithms.algorithm.Algorithm(name, description, public_settings, private_settings=None, data_format='spectrum', modes=None, data=None, results=None, debug=False)[source]

Template object for defining a fit algorithm.

Parameters:
namestr

Name of the fitting algorithm.

descriptionstr

Description of the fitting algorithm.

public_settingsSettingsDefinition or dict

Name and description of public settings for the fitting algorithm.

private_settingsSettingsDefinition or dict, optional

Name and description of private settings for the fitting algorithm.

data_format{‘spectrum’, ‘spectra’, ‘spectrogram’, ‘spectrograms’}

Set base data format the model can be applied to.

modesModes

Modes object with fit mode definitions.

dataData

Data object with spectral data and metadata.

resultsResults

Results object with model fit results and metrics.

debugbool

Whether to run in debug state, raising an error if encountered during fitting.

__init__(name, description, public_settings, private_settings=None, data_format='spectrum', modes=None, data=None, results=None, debug=False)[source]

Initialize Algorithm object.

Methods

__init__(name, description, public_settings)

Initialize Algorithm object.

add_settings(settings)

Add settings into object from a ModelSettings object.

get_debug()

Return object debug status.

get_settings()

Return user defined settings of the current object.

print([description, concise])

Print out the algorithm name and fit settings.

set_debug(debug)

Set debug state, which controls if an error is raised if model fitting is unsuccessful.

add_settings(settings)[source]

Add settings into object from a ModelSettings object.

Parameters:
settingsModelSettings

A data object containing model settings.

get_debug()[source]

Return object debug status.

get_settings()[source]

Return user defined settings of the current object.

Returns:
ModelSettings

Object containing the settings from the current object.

print(description=False, concise=False)[source]

Print out the algorithm name and fit settings.

Parameters:
descriptionbool, optional, default: False

Whether to print out a description with current settings.

concisebool, optional, default: False

Whether to print the report in a concise mode, or not.

set_debug(debug)[source]

Set debug state, which controls if an error is raised if model fitting is unsuccessful.

Parameters:
debugbool

Whether to run in debug state.

Examples using specparam.algorithms.algorithm.Algorithm

Custom Algorithms

Custom Algorithms