fix format

This commit is contained in:
yangdsh 2020-01-12 16:35:21 +00:00 committed by Dana Van Aken
parent a3774af2c1
commit cb8c597818
5 changed files with 10 additions and 10 deletions

View File

@ -13,7 +13,7 @@ profile=no
# Add files or directories to the blacklist. They should be base names, not # Add files or directories to the blacklist. They should be base names, not
# paths. # paths.
ignore=CVS,.git,manage.py,0001_initial.py,0002_enable_compression.py,0003_load_initial_data.py,0004_add_lhs.py,0005_add_workload_field.py,credentials.py,create_knob_settings.py ignore=CVS,.git,manage.py,0001_initial.py,0002_enable_compression.py,0003_load_initial_data.py,0004_add_lhs.py,0005_add_workload_field.py,0006_session_hyper_parameters.py,credentials.py,create_knob_settings.py
# ignore-patterns=**/migrations/*.py # ignore-patterns=**/migrations/*.py

View File

@ -9,11 +9,11 @@
# These parameters are not specified for any session, so they can only be set here # These parameters are not specified for any session, so they can only be set here
# address categorical knobs (enum, boolean) # address categorical knobs (enum, boolean)
enable_dummy_encoder = False ENABLE_DUMMY_ENCODER = False
# ---PIPELINE CONSTANTS--- # ---PIPELINE CONSTANTS---
# how often to run the background tests, in seconds # how often to run the background tests, in seconds
run_every = 300 RUN_EVERY = 300
# --------------------------------------------- # ---------------------------------------------

View File

@ -29,7 +29,7 @@ from website.models import PipelineData, PipelineRun, Result, Workload, SessionK
from website import db from website import db
from website.types import PipelineTaskType, AlgorithmType, VarType from website.types import PipelineTaskType, AlgorithmType, VarType
from website.utils import DataUtil, JSONUtil from website.utils import DataUtil, JSONUtil
from website.settings import enable_dummy_encoder from website.settings import ENABLE_DUMMY_ENCODER
LOG = get_task_logger(__name__) LOG = get_task_logger(__name__)
@ -565,7 +565,7 @@ def combine_workload(target_data):
X_matrix = np.vstack([X_target, X_workload]) X_matrix = np.vstack([X_target, X_workload])
# Dummy encode categorial variables # Dummy encode categorial variables
if enable_dummy_encoder: if ENABLE_DUMMY_ENCODER:
categorical_info = DataUtil.dummy_encoder_helper(X_columnlabels, categorical_info = DataUtil.dummy_encoder_helper(X_columnlabels,
mapped_workload.dbms) mapped_workload.dbms)
dummy_encoder = DummyEncoder(categorical_info['n_values'], dummy_encoder = DummyEncoder(categorical_info['n_values'],
@ -763,7 +763,7 @@ def configuration_recommendation(recommendation_input):
best_config = res.minl_conf[best_config_idx, :] best_config = res.minl_conf[best_config_idx, :]
best_config = X_scaler.inverse_transform(best_config) best_config = X_scaler.inverse_transform(best_config)
if enable_dummy_encoder: if ENABLE_DUMMY_ENCODER:
# Decode one-hot encoding into categorical knobs # Decode one-hot encoding into categorical knobs
best_config = dummy_encoder.inverse_transform(best_config) best_config = dummy_encoder.inverse_transform(best_config)

View File

@ -18,7 +18,7 @@ from analysis.preprocessing import (Bin, get_shuffle_indices,
DummyEncoder, DummyEncoder,
consolidate_columnlabels) consolidate_columnlabels)
from website.models import PipelineData, PipelineRun, Result, Workload from website.models import PipelineData, PipelineRun, Result, Workload
from website.settings import run_every, enable_dummy_encoder from website.settings import RUN_EVERY, ENABLE_DUMMY_ENCODER
from website.types import PipelineTaskType, WorkloadStatusType from website.types import PipelineTaskType, WorkloadStatusType
from website.utils import DataUtil, JSONUtil from website.utils import DataUtil, JSONUtil
@ -29,7 +29,7 @@ MIN_WORKLOAD_RESULTS_COUNT = 5
# Run the background tasks every 'RUN_EVERY' seconds # Run the background tasks every 'RUN_EVERY' seconds
@periodic_task(run_every=run_every, name="run_background_tasks") @periodic_task(run_every=RUN_EVERY, name="run_background_tasks")
def run_background_tasks(): def run_background_tasks():
LOG.debug("Starting background tasks") LOG.debug("Starting background tasks")
# Find modified and not modified workloads, we only have to calculate for the # Find modified and not modified workloads, we only have to calculate for the
@ -296,7 +296,7 @@ def run_knob_identification(knob_data, metric_data, dbms):
nonconst_metric_columnlabels.append(cl) nonconst_metric_columnlabels.append(cl)
nonconst_metric_matrix = np.hstack(nonconst_metric_matrix) nonconst_metric_matrix = np.hstack(nonconst_metric_matrix)
if enable_dummy_encoder: if ENABLE_DUMMY_ENCODER:
# determine which knobs need encoding (enums with >2 possible values) # determine which knobs need encoding (enums with >2 possible values)
categorical_info = DataUtil.dummy_encoder_helper(nonconst_knob_columnlabels, categorical_info = DataUtil.dummy_encoder_helper(nonconst_knob_columnlabels,

View File

@ -40,7 +40,7 @@ from .tasks import (aggregate_target_results, map_workload, train_ddpg,
configuration_recommendation, configuration_recommendation_ddpg) configuration_recommendation, configuration_recommendation_ddpg)
from .types import (DBMSType, KnobUnitType, MetricType, from .types import (DBMSType, KnobUnitType, MetricType,
TaskType, VarType, WorkloadStatusType, AlgorithmType) TaskType, VarType, WorkloadStatusType, AlgorithmType)
from .utils import (JSONUtil, LabelUtil, MediaUtil, TaskUtil, ConversionUtil, get_constants) from .utils import (JSONUtil, LabelUtil, MediaUtil, TaskUtil)
from .settings import LOG_DIR, TIME_ZONE from .settings import LOG_DIR, TIME_ZONE
from .set_default_knobs import set_default_knobs from .set_default_knobs import set_default_knobs