Skip to content

Commit 5ab8005

Browse files
committed
Making top k in horizontal orientation
1 parent 6fb41b3 commit 5ab8005

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ads/feature_store/feature_stat.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ def from_json(cls, json_dict: dict):
137137
lower_bound=json_dict.get(cls.CONST_LOWER_BOUND),
138138
upper_bound=json_dict.get(cls.CONST_UPPER_BOUND),
139139
)
140-
141140
else:
142141
return None
143142

@@ -157,12 +156,14 @@ def from_json(cls, json_dict: dict):
157156
def add_to_figure(self, fig: Figure, xaxis: int, yaxis: int):
158157
xaxis_str, yaxis_str, x_str, y_str = self.get_x_y_str_axes(xaxis, yaxis)
159158
if type(self.elements) == list and len(self.elements) > 0:
160-
x_axis = [element.value for element in self.elements]
161-
y_axis = [element.estimate for element in self.elements]
162-
fig.add_bar(x=x_axis, y=y_axis, xaxis=x_str, yaxis=y_str, name="")
159+
y_axis = [element.value for element in self.elements]
160+
x_axis = [element.estimate for element in self.elements]
161+
fig.add_bar(
162+
x=x_axis, y=y_axis, xaxis=x_str, yaxis=y_str, name="", orientation="h"
163+
)
163164
fig.layout.annotations[xaxis].text = self.CONST_TOP_K_FREQUENT_TITLE
164-
fig.layout[yaxis_str]["title"] = "Count"
165-
fig.layout[xaxis_str]["title"] = "Element"
165+
fig.layout[yaxis_str]["title"] = "Element"
166+
fig.layout[xaxis_str]["title"] = "Count"
166167

167168

168169
class FeatureStatistics:

0 commit comments

Comments
 (0)