diff --git a/autoemulate/compare.py b/autoemulate/compare.py index 4c70b7f7..dee40c3e 100644 --- a/autoemulate/compare.py +++ b/autoemulate/compare.py @@ -1,16 +1,9 @@ -import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.base import BaseEstimator from sklearn.decomposition import PCA -from sklearn.metrics import make_scorer -from sklearn.model_selection import cross_validate from sklearn.model_selection import KFold -from sklearn.model_selection import PredefinedSplit -from sklearn.model_selection import train_test_split -from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler -from sklearn.utils.validation import check_is_fitted from sklearn.utils.validation import check_X_y from tqdm.autonotebook import tqdm @@ -27,7 +20,6 @@ from autoemulate.plotting import _plot_model from autoemulate.printing import _print_setup from autoemulate.save import ModelSerialiser -from autoemulate.utils import _ensure_2d from autoemulate.utils import _get_full_model_name from autoemulate.utils import _redirect_warnings from autoemulate.utils import get_model_name diff --git a/autoemulate/cross_validate.py b/autoemulate/cross_validate.py index 50e45d27..9924cbd0 100644 --- a/autoemulate/cross_validate.py +++ b/autoemulate/cross_validate.py @@ -5,8 +5,6 @@ import pandas as pd from sklearn.metrics import make_scorer from sklearn.model_selection import cross_validate -from sklearn.model_selection import PredefinedSplit -from sklearn.model_selection import train_test_split from autoemulate.utils import get_model_name from autoemulate.utils import get_model_params diff --git a/autoemulate/emulators/conditional_neural_process.py b/autoemulate/emulators/conditional_neural_process.py index 29b15751..2f7d72d8 100644 --- a/autoemulate/emulators/conditional_neural_process.py +++ b/autoemulate/emulators/conditional_neural_process.py @@ -9,7 +9,6 @@ from sklearn.utils.validation import check_array from sklearn.utils.validation import check_is_fitted from sklearn.utils.validation import check_X_y -from skopt.space import Real from skorch import NeuralNetRegressor from skorch.callbacks import EarlyStopping from skorch.callbacks import GradientNormClipping diff --git a/autoemulate/emulators/gaussian_process_sklearn.py b/autoemulate/emulators/gaussian_process_sklearn.py index 41dbfe33..f4c1bd49 100644 --- a/autoemulate/emulators/gaussian_process_sklearn.py +++ b/autoemulate/emulators/gaussian_process_sklearn.py @@ -10,7 +10,6 @@ from sklearn.utils.validation import check_is_fitted from sklearn.utils.validation import check_X_y from skopt.space import Categorical -from skopt.space import Integer from skopt.space import Real from autoemulate.utils import _suppress_convergence_warnings diff --git a/autoemulate/emulators/gaussian_process_torch.py b/autoemulate/emulators/gaussian_process_torch.py index 92ef18b4..f9011fe3 100644 --- a/autoemulate/emulators/gaussian_process_torch.py +++ b/autoemulate/emulators/gaussian_process_torch.py @@ -1,30 +1,13 @@ -from copy import deepcopy - import gpytorch import numpy as np import torch -from scipy.stats import loguniform -from scipy.stats import randint from sklearn.base import BaseEstimator from sklearn.base import RegressorMixin -from sklearn.exceptions import DataConversionWarning -from sklearn.metrics import r2_score -from sklearn.model_selection import train_test_split from sklearn.preprocessing._data import _handle_zeros_in_scale from sklearn.utils import check_array from sklearn.utils import check_X_y from sklearn.utils.validation import check_is_fitted -from skopt.space import Categorical -from skopt.space import Integer -from skopt.space import Real -from skorch.callbacks import Checkpoint -from skorch.callbacks import EarlyStopping -from skorch.callbacks import EpochScoring from skorch.callbacks import LRScheduler -from skorch.callbacks import ProgressBar -from skorch.dataset import Dataset -from skorch.dataset import ValidSplit -from skorch.helper import predefined_split from skorch.probabilistic import ExactGPRegressor from autoemulate.emulators.gaussian_process_utils import EarlyStoppingCustom diff --git a/autoemulate/emulators/polynomials.py b/autoemulate/emulators/polynomials.py index f626019e..7c54e1bc 100644 --- a/autoemulate/emulators/polynomials.py +++ b/autoemulate/emulators/polynomials.py @@ -8,7 +8,6 @@ from sklearn.utils.validation import check_is_fitted from sklearn.utils.validation import check_X_y from skopt.space import Categorical -from skopt.space import Integer class SecondOrderPolynomial(BaseEstimator, RegressorMixin): diff --git a/autoemulate/emulators/random_forest.py b/autoemulate/emulators/random_forest.py index ca505133..bd85c0cc 100644 --- a/autoemulate/emulators/random_forest.py +++ b/autoemulate/emulators/random_forest.py @@ -7,7 +7,6 @@ from sklearn.utils.validation import check_X_y from skopt.space import Categorical from skopt.space import Integer -from skopt.space import Real class RandomForest(BaseEstimator, RegressorMixin): diff --git a/autoemulate/logging_config.py b/autoemulate/logging_config.py index 62a863dc..0e9f13ff 100644 --- a/autoemulate/logging_config.py +++ b/autoemulate/logging_config.py @@ -1,7 +1,6 @@ import logging import os import sys -import warnings from pathlib import Path diff --git a/autoemulate/model_processing.py b/autoemulate/model_processing.py index 54d54685..65da5850 100644 --- a/autoemulate/model_processing.py +++ b/autoemulate/model_processing.py @@ -2,9 +2,6 @@ from sklearn.multioutput import MultiOutputRegressor from sklearn.pipeline import Pipeline -from autoemulate.utils import get_model_name -from autoemulate.utils import get_short_model_name - def _turn_models_into_multioutput(models, y): """Turn single output models into multioutput models if y is 2D. diff --git a/autoemulate/plotting.py b/autoemulate/plotting.py index aba5c0d8..76b85678 100644 --- a/autoemulate/plotting.py +++ b/autoemulate/plotting.py @@ -1,5 +1,4 @@ import inspect -import time import matplotlib.pyplot as plt import numpy as np @@ -7,7 +6,6 @@ from sklearn.pipeline import Pipeline from autoemulate.utils import _ensure_2d -from autoemulate.utils import get_model_name def _validate_inputs(cv_results, model_name): diff --git a/autoemulate/save.py b/autoemulate/save.py index 0c491e4a..35abf1b6 100644 --- a/autoemulate/save.py +++ b/autoemulate/save.py @@ -1,10 +1,6 @@ -import json -import os from pathlib import Path import joblib -import numpy as np -import sklearn from autoemulate.utils import get_model_name diff --git a/tests/models/test_cnp.py b/tests/models/test_cnp.py index e4e46f2f..f650ae36 100644 --- a/tests/models/test_cnp.py +++ b/tests/models/test_cnp.py @@ -150,7 +150,8 @@ def cnp_module(): output_dim=1, hidden_dim=32, latent_dim=64, - hidden_layers=2, + hidden_layers_enc=2, + hidden_layers_dec=2, activation=nn.ReLU, )