-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from george0st/change
Switch to standard CSV sep and decimal
- Loading branch information
Showing
21 changed files
with
639 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"name": "Financial services", | ||
"name": "Model setting", | ||
"description": "The machine learning meta-model with synthetic data (useful for MLOps/feature store), part of the quality gate concept.", | ||
"kind": "model", | ||
"spec": { | ||
"version": "0.1.9" | ||
"version": "0.1.9", | ||
"CSV_SEPARATOR": ",", | ||
"CSV_DECIMAL": "." | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import json | ||
import math | ||
import uuid | ||
import os | ||
import numpy as np | ||
|
||
class Singleton (type): | ||
_instances = {} | ||
def __call__(cls, *args, **kwargs): | ||
if cls not in cls._instances: | ||
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) | ||
return cls._instances[cls] | ||
|
||
|
||
class Setup(metaclass=Singleton): | ||
|
||
def __init__(self, model_path): | ||
self._model_setting={} | ||
|
||
with open(os.path.join(model_path, "model.json"), "r") as json_file: | ||
setting = json.load(json_file) | ||
|
||
self._model_setting=setting["spec"] | ||
|
||
@property | ||
def csv_separator(self): | ||
return self._model_setting["CSV_SEPARATOR"] | ||
|
||
@property | ||
def csv_decimal(self): | ||
return self._model_setting["CSV_DECIMAL"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters