-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Weisu Yin
authored
May 10, 2023
1 parent
311e9e0
commit 054878f
Showing
10 changed files
with
83 additions
and
82 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
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
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 |
---|---|---|
@@ -1,36 +1,6 @@ | ||
import copy | ||
import os | ||
|
||
import yaml | ||
|
||
from .constant import TABULAR_SAGEMAKER | ||
from .sagemaker_backend import SagemakerBackend | ||
|
||
|
||
class TabularSagemakerBackend(SagemakerBackend): | ||
name = TABULAR_SAGEMAKER | ||
|
||
def _construct_config(self, predictor_init_args, predictor_fit_args, leaderboard, **kwargs): | ||
assert self.predictor_type is not None | ||
if "feature_metadata" in predictor_fit_args: | ||
predictor_fit_args = copy.deepcopy(predictor_fit_args) | ||
feature_metadata = predictor_fit_args.pop("feature_metadata") | ||
feature_metadata = dict( | ||
type_map_raw=feature_metadata.type_map_raw, | ||
type_map_special=feature_metadata.get_type_map_special(), | ||
) | ||
assert ( | ||
"feature_metadata" not in kwargs | ||
), "feature_metadata in both `predictor_fit_args` and kwargs. This should not happen." | ||
kwargs["feature_metadata"] = feature_metadata | ||
config = dict( | ||
predictor_type=self.predictor_type, | ||
predictor_init_args=predictor_init_args, | ||
predictor_fit_args=predictor_fit_args, | ||
leaderboard=leaderboard, | ||
**kwargs, | ||
) | ||
path = os.path.join(self.local_output_path, "utils", "config.yaml") | ||
with open(path, "w") as f: | ||
yaml.dump(config, f) | ||
return path |
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
Oops, something went wrong.