mirror of
https://github.com/elastic/eland.git
synced 2025-07-11 00:02:14 +08:00
Apply Black 20.8b1 formatting
This commit is contained in:
parent
1d6311164e
commit
1a8a301cd6
@ -218,7 +218,8 @@ class ImportedMLModel(MLModel):
|
|||||||
body["definition"] = serializer.serialize_model()
|
body["definition"] = serializer.serialize_model()
|
||||||
|
|
||||||
self._client.ml.put_trained_model(
|
self._client.ml.put_trained_model(
|
||||||
model_id=self._model_id, body=body,
|
model_id=self._model_id,
|
||||||
|
body=body,
|
||||||
)
|
)
|
||||||
|
|
||||||
def predict(self, X: Union[List[float], List[List[float]]]) -> np.ndarray:
|
def predict(self, X: Union[List[float], List[List[float]]]) -> np.ndarray:
|
||||||
|
@ -93,7 +93,8 @@ class LGBMForestTransformer(ModelTransformer):
|
|||||||
self, tree_id: int, node_id: int, tree_node_json_obj: Dict[str, Any]
|
self, tree_id: int, node_id: int, tree_node_json_obj: Dict[str, Any]
|
||||||
) -> TreeNode:
|
) -> TreeNode:
|
||||||
return TreeNode(
|
return TreeNode(
|
||||||
node_idx=node_id, leaf_value=[float(tree_node_json_obj["leaf_value"])],
|
node_idx=node_id,
|
||||||
|
leaf_value=[float(tree_node_json_obj["leaf_value"])],
|
||||||
)
|
)
|
||||||
|
|
||||||
def build_tree(self, tree_id: int, tree_json_obj: Dict[str, Any]) -> Tree:
|
def build_tree(self, tree_id: int, tree_json_obj: Dict[str, Any]) -> Tree:
|
||||||
|
@ -137,7 +137,12 @@ class Query:
|
|||||||
self._aggs[name] = agg
|
self._aggs[name] = agg
|
||||||
|
|
||||||
def hist_aggs(
|
def hist_aggs(
|
||||||
self, name: str, field: str, min_value: Any, max_value: Any, num_bins: int,
|
self,
|
||||||
|
name: str,
|
||||||
|
field: str,
|
||||||
|
min_value: Any,
|
||||||
|
max_value: Any,
|
||||||
|
num_bins: int,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Add histogram agg e.g.
|
Add histogram agg e.g.
|
||||||
|
@ -30,7 +30,8 @@ ELASTICSEARCH_HOST = os.environ.get("ELASTICSEARCH_HOST") or "localhost"
|
|||||||
TEST_SUITE = os.environ.get("TEST_SUITE", "xpack")
|
TEST_SUITE = os.environ.get("TEST_SUITE", "xpack")
|
||||||
if TEST_SUITE == "xpack":
|
if TEST_SUITE == "xpack":
|
||||||
ES_TEST_CLIENT = Elasticsearch(
|
ES_TEST_CLIENT = Elasticsearch(
|
||||||
ELASTICSEARCH_HOST, http_auth=("elastic", "changeme"),
|
ELASTICSEARCH_HOST,
|
||||||
|
http_auth=("elastic", "changeme"),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
ES_TEST_CLIENT = Elasticsearch(ELASTICSEARCH_HOST)
|
ES_TEST_CLIENT = Elasticsearch(ELASTICSEARCH_HOST)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user