r"""Save the feature map to disk. Parameters ---------- model : alphapy.Model The model object containing the feature map. timestamp : str Date in yyyy-mm-dd format. Returns ------- None : None
(model, timestamp)
| 590 | # |
| 591 | |
| 592 | def save_feature_map(model, timestamp): |
| 593 | r"""Save the feature map to disk. |
| 594 | |
| 595 | Parameters |
| 596 | ---------- |
| 597 | model : alphapy.Model |
| 598 | The model object containing the feature map. |
| 599 | timestamp : str |
| 600 | Date in yyyy-mm-dd format. |
| 601 | |
| 602 | Returns |
| 603 | ------- |
| 604 | None : None |
| 605 | |
| 606 | """ |
| 607 | |
| 608 | logger.info("Saving Feature Map") |
| 609 | |
| 610 | # Extract model parameters. |
| 611 | directory = model.specs['directory'] |
| 612 | |
| 613 | # Create full path name. |
| 614 | |
| 615 | filename = 'feature_map_' + timestamp + '.pkl' |
| 616 | full_path = SSEP.join([directory, 'model', filename]) |
| 617 | |
| 618 | # Save model object |
| 619 | |
| 620 | logger.info("Writing feature map to %s", full_path) |
| 621 | joblib.dump(model.feature_map, full_path) |
| 622 | |
| 623 | |
| 624 | # |