wizata-dsapi 1.3.34__tar.gz → 1.3.35__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/PKG-INFO +1 -1
  2. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/mlmodel.py +1 -5
  3. wizata_dsapi-1.3.35/wizata_dsapi/version.py +1 -0
  4. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/wizata_dsapi_client.py +32 -49
  5. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi.egg-info/PKG-INFO +1 -1
  6. wizata_dsapi-1.3.34/wizata_dsapi/version.py +0 -1
  7. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/LICENSE.txt +0 -0
  8. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/README.rst +0 -0
  9. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/setup.cfg +0 -0
  10. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/setup.py +0 -0
  11. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/__init__.py +0 -0
  12. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/api_config.py +0 -0
  13. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/api_dto.py +0 -0
  14. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/api_interface.py +0 -0
  15. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/bucket.py +0 -0
  16. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/business_label.py +0 -0
  17. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/context.py +0 -0
  18. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/dataframe_toolkit.py +0 -0
  19. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/datapoint.py +0 -0
  20. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/datastore.py +0 -0
  21. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/ds_dataframe.py +0 -0
  22. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/dsapi_json_encoder.py +0 -0
  23. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/evaluation.py +0 -0
  24. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/execution.py +0 -0
  25. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/experiment.py +0 -0
  26. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/group_system.py +0 -0
  27. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/ilogger.py +0 -0
  28. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/insight.py +0 -0
  29. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/model_toolkit.py +0 -0
  30. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/models/__init__.py +0 -0
  31. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/models/common.py +0 -0
  32. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/paged_query_result.py +0 -0
  33. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/pipeline.py +0 -0
  34. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/pipeline_image.py +0 -0
  35. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/plot.py +0 -0
  36. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/plots/__init__.py +0 -0
  37. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/plots/common.py +0 -0
  38. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/request.py +0 -0
  39. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/script.py +0 -0
  40. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/scripts/__init__.py +0 -0
  41. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/scripts/common.py +0 -0
  42. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/solution_component.py +0 -0
  43. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/streamlit_utils.py +0 -0
  44. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/template.py +0 -0
  45. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/trigger.py +0 -0
  46. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/twin.py +0 -0
  47. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/twinregistration.py +0 -0
  48. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/wizard_function.py +0 -0
  49. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/wizard_request.py +0 -0
  50. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi/words.py +0 -0
  51. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi.egg-info/SOURCES.txt +0 -0
  52. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi.egg-info/dependency_links.txt +0 -0
  53. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi.egg-info/requires.txt +0 -0
  54. {wizata_dsapi-1.3.34 → wizata_dsapi-1.3.35}/wizata_dsapi.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizata_dsapi
3
- Version: 1.3.34
3
+ Version: 1.3.35
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -222,10 +222,6 @@ class ModelInfo:
222
222
  obj["alias"] = self.alias
223
223
  if self.model_type is not None:
224
224
  obj["model_type"] = self.model_type
225
- if self.file_format is not None:
226
- obj["file_format"] = self.file_format
227
- if self.source is not None:
228
- obj["source"] = self.source
229
225
  if self.property_name is not None:
230
226
  obj["property_name"] = self.property_name
231
227
  if self.is_active is not None:
@@ -251,7 +247,7 @@ class ModelInfo:
251
247
  if "model_type" in obj.keys():
252
248
  self.model_type = obj["model_type"]
253
249
  if "file_format" in obj.keys():
254
- self.key = obj["file_format"]
250
+ self.file_format = obj["file_format"]
255
251
  if "source" in obj.keys():
256
252
  self.source = obj["source"]
257
253
  if "property_name" in obj.keys():
@@ -0,0 +1 @@
1
+ __version__ = "1.3.35"
@@ -1078,55 +1078,38 @@ class WizataDSAPIClient(ApiInterface):
1078
1078
  else:
1079
1079
  raise self.__raise_error(response)
1080
1080
 
1081
- def register_model(self,
1082
- model_key,
1083
- train_model,
1084
- df: pandas.DataFrame,
1085
- scaler=None,
1086
- has_anomalies: bool = False,
1087
- has_target_feat: bool = False,
1088
- experiment_key = None) -> tuple[ModelInfo, pandas.DataFrame]:
1089
- """
1090
- Register a Machine Learning model to Wizata.
1091
- Model is tested by the API against a sample dataframe.
1092
- :param model_key: logical string id to identify the model.
1093
- :param train_model: trained model (must be compatible with pickle library)
1094
- :param df: sample dataframe.
1095
- :param scaler: scaler (must be compatible with pickle library)
1096
- :param has_anomalies: True is model generate Anomalies
1097
- :param has_target_feat: True if model need a target feature to be selected
1098
- :param experiment_key: Reference of an experiment to which link the generated ML Model
1099
- :return: registered ML Model , pandas.DataFrame
1100
- """
1101
- if model_key is None and isinstance(model_key, str):
1102
- raise ValueError('Please provide a str Model Key to identify the model.')
1103
- if train_model is None:
1104
- raise ValueError('Trained Machine Learning model should not be null')
1105
- elif df is None:
1106
- raise ValueError('A sample dataframe must be provided')
1107
-
1108
- ml_model = ModelInfo(key=model_key)
1109
- ml_model.trained_model = train_model
1110
- if scaler is not None:
1111
- ml_model.scaler = scaler
1112
- ml_model.has_anomalies = has_anomalies
1113
- ml_model.has_target_feat = has_target_feat
1114
- ml_model.input_columns = df.columns
1115
-
1116
- if experiment_key is not None:
1117
- ml_model.experimentId = self.get(experiment_key=experiment_key).experiment_id
1118
-
1119
- try:
1120
- result_df = predict(df, ml_model)
1121
- if result_df is not None:
1122
- ml_model.status = "valid"
1123
- #TODO: proper method to upload and download from registry to modify this one
1124
- ## self.upsert(ml_model)
1125
- return ml_model, result_df
1126
- else:
1127
- raise RuntimeError('no dataframe was generated by your model while testing predict capabilities')
1128
- except Exception as e:
1129
- raise RuntimeError('not able to validated the model : ' + str(e))
1081
+ def upload_model(self,
1082
+ model_info: ModelInfo):
1083
+ """
1084
+ upload a model within the model repository.
1085
+ :param model_info: model info, with at least key (+twin, +property, +alias) and trained_model.
1086
+ """
1087
+ if model_info.trained_model is None:
1088
+ raise ValueError("model_info must have a trained model as bytes content pkl or pt")
1089
+ files = {
1090
+ "trained_model": (
1091
+ "trained_model." + model_info.file_format ,
1092
+ model_info.trained_model,
1093
+ "application/octet-stream",
1094
+ )
1095
+ }
1096
+ headers = self.__header()
1097
+ headers.pop("Content-Type", None)
1098
+ response = requests.post(self.__url() + f"models",
1099
+ headers=headers,
1100
+ data={
1101
+ "payload": json.dumps(model_info.to_json())
1102
+ },
1103
+ files=files)
1104
+ if response.status_code == 200:
1105
+ response_json = response.json()
1106
+ if "identifier" in response_json:
1107
+ key , twin, property, alias = ModelInfo.split_identifier(response_json["identifier"])
1108
+ if alias is not None:
1109
+ model_info.alias = alias
1110
+ return model_info
1111
+ else:
1112
+ raise self.__raise_error(response)
1130
1113
 
1131
1114
  def upsert_experiment(self, key: str, name: str, pipeline=None, twin=None):
1132
1115
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizata-dsapi
3
- Version: 1.3.34
3
+ Version: 1.3.35
4
4
  Summary: Wizata Data Science Toolkit
5
5
  Author: Wizata S.A.
6
6
  Author-email: info@wizata.com
@@ -1 +0,0 @@
1
- __version__ = "1.3.34"
File without changes
File without changes
File without changes
File without changes