Welcome to usage karma_analytics’s documentation!

karma_analysis.compare_models(data: dict) tuple

compare_models _summary_

Compare the differents methods and returns the best model

Parameters:

data (dict) – _description_

Returns:

_description_

Return type:

tuple

karma_analysis.convert(k: ndarray, f: ndarray) ndarray

convert create probability

Parameters:
  • k (np.ndarray) – karma

  • f (np.ndarray) – feed

Returns:

proability

Return type:

np.ndarray

karma_analysis.fit(data: dict, func, p0=None) ndarray

fit _summary_

_extended_summary_

Parameters:
  • data (dict) – _description_

  • func (_type_) – _description_

  • p0 (_type_, optional) – _description_, defaults to None

Returns:

_description_

Return type:

np.ndarray

karma_analysis.lin(x: ndarray, a: float, b: float) ndarray

lin _summary_

Compute linear value from y=ax+b

Parameters:
  • x (np.ndarray) – _description_

  • a (float) – _description_

  • b (float) – _description_

Returns:

_description_

Return type:

np.ndarray

karma_analysis.plot(data: dict, params, func, name: str) None

plot _summary_

Display the plot of the best model

Parameters:
  • data (dict) – _description_

  • params (_type_) – _description_

  • func (_type_) – _description_

  • name (str) – _description_

karma_analysis.quad(x: ndarray, a: float, b: float, c: float) ndarray

quad _summary_

Compute quadratic value from y=ax2+bx+c

Parameters:
  • x (np.ndarray) – _description_

  • a (float) – _description_

  • b (float) – _description_

  • c (float) – _description_

Returns:

_description_

Return type:

np.ndarray

karma_analysis.readData(f: str) dict

readData load filename

This function takes one file as input and reorder json content to reindex the final dictionary

Parameters:

f (str) – filename

Raises:

RuntimeError – json.JSONDecodeError

Returns:

data

Return type:

dict

karma_analysis.sin(x: ndarray, a: float, b: float, c: float, d: float) ndarray

sin _summary_

Compute sinusoidal value from y=a*sin(bx+c)+d

Parameters:
  • x (np.ndarray) – _description_

  • a (float) – _description_

  • b (float) – _description_

  • c (float) – _description_

  • d (float) – _description_

Returns:

_description_

Return type:

np.ndarray