Skip to content

Instantly share code, notes, and snippets.

@dan0nchik
Created April 16, 2021 20:52
Show Gist options
  • Save dan0nchik/bfc361c6e8669cbac3e94b7eb495e076 to your computer and use it in GitHub Desktop.
Save dan0nchik/bfc361c6e8669cbac3e94b7eb495e076 to your computer and use it in GitHub Desktop.
FAILED [100%]Recreating table test_when_clean with data from file
Done
Task: cls
| iter | target | algo_i... | prepro... |
-------------------------------------------------
Child Iteration accuracy: 0.77528
Child Iteration accuracy: 0.786516
| 1 | 0.7865 | 2.063 | 1.061 |
Child Iteration accuracy: 0.786516
Child Iteration accuracy: 0.808988
| 2 | 0.809 | 6.983 | 0.008468 |
Child Iteration accuracy: 0.786516
Child Iteration accuracy: 0.808988
| 3 | 0.809 | 7.0 | 2.0 |
Child Iteration accuracy: 0.786516
Child Iteration accuracy: 0.808988
| 4 | 0.809 | 6.982 | 0.04241 |
Child Iteration accuracy: 0.786516
100%|██████████| 1/1 [00:00<00:00, 5.56it/s]
test_automl_when_clean_df.py:7 (test_main[BayesianOptimizer])
self = <bayes_opt.target_space.TargetSpace object at 0x11ea70f70>
params = {'algo_index_tuned': 6.99999761791255, 'preprocess_method': 1.9999986923442028}
def probe(self, params):
"""
Evaulates a single point x, to obtain the value y and then records them
as observations.
Notes
-----
If x has been previously seen returns a cached value of y.
Parameters
----------
x : ndarray
a single point, with len(x) == self.dim
Returns
-------
y : float
target function value.
"""
x = self._as_array(params)
try:
> target = self._cache[_hashable(x)]
E KeyError: (6.99999761791255, 1.9999986923442028)
../../venv/lib/python3.9/site-packages/bayes_opt/target_space.py:191: KeyError
During handling of the above exception, another exception occurred:
self = <bayes_opt.target_space.TargetSpace object at 0x11eaeb520>
params = {'learning_rate': 0.5100947196305086, 'max_depth': 25.19044276398371, 'min_sample_weight_leaf': 8.62659476429784, 'n_estimators': 85.05593483656696, ...}
def probe(self, params):
"""
Evaulates a single point x, to obtain the value y and then records them
as observations.
Notes
-----
If x has been previously seen returns a cached value of y.
Parameters
----------
x : ndarray
a single point, with len(x) == self.dim
Returns
-------
y : float
target function value.
"""
x = self._as_array(params)
try:
> target = self._cache[_hashable(x)]
E KeyError: (0.5100947196305086, 25.19044276398371, 8.62659476429784, 85.05593483656696, 1.6246289857511451)
../../venv/lib/python3.9/site-packages/bayes_opt/target_space.py:191: KeyError
During handling of the above exception, another exception occurred:
optimizer = 'BayesianOptimizer'
tmpdir = local('/private/var/folders/s_/9f0c9ct96xv0p4b0dvvd4xtr0000gn/T/pytest-of-danonchik/pytest-12/test_main_BayesianOptimizer_0')
@pytest.mark.parametrize("optimizer", ["OptunaSearch", "BayesianOptimizer"])
def test_main(optimizer, tmpdir):
m = AutoML(connection_context)
> m.fit(
table_name="test_when_clean",
file_path="../../data/cleaned_train.csv",
target="Survived",
id_column="PassengerId",
steps=5,
categorical_features=["Survived"],
optimizer=optimizer,
)
test_automl_when_clean_df.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../automl.py:96: in fit
self.opt = pipe.train(
../../pipeline/pipeline.py:70: in train
self.opt.tune()
../../optimizers/bayes.py:149: in tune
opt.maximize(n_iter=self.iter, init_points=1)
../../venv/lib/python3.9/site-packages/bayes_opt/bayesian_optimization.py:185: in maximize
self.probe(x_probe, lazy=False)
../../venv/lib/python3.9/site-packages/bayes_opt/bayesian_optimization.py:116: in probe
self._space.probe(params)
../../venv/lib/python3.9/site-packages/bayes_opt/target_space.py:194: in probe
target = self.target_func(**params)
../../optimizers/bayes.py:88: in objective
opt.maximize(n_iter=1, init_points=1)
../../venv/lib/python3.9/site-packages/bayes_opt/bayesian_optimization.py:185: in maximize
self.probe(x_probe, lazy=False)
../../venv/lib/python3.9/site-packages/bayes_opt/bayesian_optimization.py:116: in probe
self._space.probe(params)
../../venv/lib/python3.9/site-packages/bayes_opt/target_space.py:194: in probe
target = self.target_func(**params)
../../optimizers/bayes.py:115: in child_objective
acc = algorithm.score(self.inner_data, self.inner_data.test)
../../algorithms/base_algo.py:23: in score
return self.model.score(df, key=data.id_colm, label=data.target)
../../venv/lib/python3.9/site-packages/hana_ml/algorithms/pal/trees.py:4362: in score
prediction = self.predict(data=data, key=key, features=features,
../../venv/lib/python3.9/site-packages/hana_ml/algorithms/pal/trees.py:4292: in predict
return super(HybridGradientBoostingClassifier, self)._predict(
../../venv/lib/python3.9/site-packages/hana_ml/algorithms/pal/sqlgen.py:318: in function_with_sql_tracing
return func(*args, **kwargs)
../../venv/lib/python3.9/site-packages/hana_ml/algorithms/pal/trees.py:3749: in _predict
call_pal_auto(conn,
../../venv/lib/python3.9/site-packages/hana_ml/algorithms/pal/pal_base.py:338: in call_pal_auto
if try_exec(cur, sql):
../../venv/lib/python3.9/site-packages/hana_ml/algorithms/pal/pal_base.py:309: in try_exec
execute_logged(cur, sql, conn.sql_tracer) # SQLTRACE added sql_tracer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cursor = <pyhdbcli.Cursor object at 0x11ea2fc90>
statement = 'DO (IN in_0 TABLE ("PassengerId" INT, "Pclass" INT, "Age" DOUBLE, "SibSp" INT, "Parch" INT, "Fare" DOUBLE, "Sex_femal... COLUMN TABLE "#PAL_HGBT_PREDICT_RESULT_TBL_69_0658FF16_9EF5_11EB_9E5C_6C4008A8C5E6" AS (SELECT * FROM :out_0);\nEND\n'
sql_tracer = <hana_ml.dataframe.SqlTrace object at 0x110671430>
def execute_logged(cursor, statement, sql_tracer=None): # SQLTRACE added sql_tracer
"""
Execute a SQL statement and log that we did it.
Parameters
----------
cursor : hdbcli.dbapi.Cursor
Database cursor to execute the statement through.
statement : str
SQL statement to execute.
"""
logger.info("Executing SQL: %s", statement)
# SQLTRACE
if sql_tracer:
sql_tracer.trace_sql(statement)
> cursor.execute(statement)
E hdbcli.dbapi.Error: (256, 'sql processing error: "DEVELOPER"."(DO statement)": line 9 col 1 (at pos 592): search table error: _SYS_AFL.AFLPAL:HGBTPREDICT_ANY: [102] (range 1) TypeMismatch exception: Column \'ID\' does not exist')
../../venv/lib/python3.9/site-packages/hana_ml/ml_base.py:339: Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment