(intercept, coefs, model_type)
| 21 | |
| 22 | |
| 23 | def write_model(intercept, coefs, model_type): |
| 24 | coefficients_string = '%s' % (','.join([str(x) for x in coefs[0]])) |
| 25 | file_content = ''' |
| 26 | #include "%s" |
| 27 | // clang-format off |
| 28 | const double %s_coefficients[%d] = {%s}; |
| 29 | double %s_intercept = %lf; |
| 30 | // clang-format on |
| 31 | ''' % (f'{model_type}_model.h', model_type, len(coefs[0]), coefficients_string, model_type, intercept) |
| 32 | file_name = f'{model_type}_model.cpp' |
| 33 | file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'generated', file_name) |
| 34 | with open(file_path, 'w') as f: |
| 35 | f.write(file_content) |
| 36 | |
| 37 | def prepare_data(first_class, second_class, blacklisted_channels=None): |
| 38 | # use different windows, its kinda data augmentation |
no outgoing calls
no test coverage detected