def least_log_mean_squares_fit(q_values, data, predicted_labels, sample, output_preprocessor, fraction_bounds=(0.5, 0.5, 0.1)):
    'Fits the data with a model curve with ``scipy.optimize.curve_fit`` using ``predicted_labels`` as start values.'
    prep_labels = output_preprocessor.apply_preprocessing(predicted_labels)[0]
    start_values = np.array(prep_labels)[0]
    bounds = ([(val - (bound * abs(val))) for (val, bound) in zip(start_values, fraction_bounds)], [(val + (bound * abs(val))) for (val, bound) in zip(start_values, fraction_bounds)])
    fit_result = curve_fit(fitting_model(q_values, sample, output_preprocessor), q_values, np.log10(data), p0=start_values, bounds=bounds)
    return output_preprocessor.restore_labels(np.atleast_2d(fit_result[0]))
Fits the data with a model curve with ``scipy.optimize.curve_fit`` using ``predicted_labels`` as start values.
def least_log_mean_squares_fit(q_values, data, predicted_labels, sample, output_preprocessor, fraction_bounds=(0.5, 0.5, 0.1)):
    
    prep_labels = output_preprocessor.apply_preprocessing(predicted_labels)[0]
    start_values = np.array(prep_labels)[0]
    bounds = ([(val - (bound * abs(val))) for (val, bound) in zip(start_values, fraction_bounds)], [(val + (bound * abs(val))) for (val, bound) in zip(start_values, fraction_bounds)])
    fit_result = curve_fit(fitting_model(q_values, sample, output_preprocessor), q_values, np.log10(data), p0=start_values, bounds=bounds)
    return output_preprocessor.restore_labels(np.atleast_2d(fit_result[0]))