Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from credo-ai/fix/modify_modelprofiler_container
Browse files Browse the repository at this point in the history
Modified profiler container, removed feature names as a mandatory info.
  • Loading branch information
IanAtCredo authored Dec 13, 2022
2 parents ed6b5ea + d51683e commit 02b575b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions connect/evidence/lens_evidence/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def to_evidence(self, **metadata):
]

def _validate(self, data):
necessary_index = ["parameters", "feature_names", "model_name"]
necessary_index = ["parameters", "model_name"]
if list(data.columns) != ["results"]:
raise ValidationError(
"Model profiler data must only have one column: 'results'"
)
if sum(data.index.isin(necessary_index)) != 3:
if sum(data.index.isin(necessary_index)) != 2:
raise ValidationError(f"Model profiler data must contain {necessary_index}")
8 changes: 5 additions & 3 deletions connect/evidence/lens_evidence/evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ def __init__(self, data: DataFrame, additional_labels: dict = None, **metadata):
@property
def data(self):
parameters = self._data.loc["parameters"]
features_names = self._data.loc["feature_names"]
remaining_info = self._data[
~self._data.index.isin(["parameters", "feature_names", "model_name"])
]
return {
output = {
"info": remaining_info.to_dict(),
"parameters": parameters,
"features_names": features_names,
}
if "feature_names" in self._data.index:
output["features_names"] = self._data.loc["feature_names"]

return output

@property
def base_label(self):
Expand Down

0 comments on commit 02b575b

Please sign in to comment.