Skip to content

Commit

Permalink
remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mastoffel committed Oct 10, 2024
1 parent 8abfcf9 commit b68c497
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 42 deletions.
8 changes: 0 additions & 8 deletions autoemulate/compare.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions autoemulate/cross_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion autoemulate/emulators/conditional_neural_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion autoemulate/emulators/gaussian_process_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions autoemulate/emulators/gaussian_process_torch.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion autoemulate/emulators/polynomials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion autoemulate/emulators/random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion autoemulate/logging_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
import os
import sys
import warnings
from pathlib import Path


Expand Down
3 changes: 0 additions & 3 deletions autoemulate/model_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions autoemulate/plotting.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import inspect
import time

import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import PredictionErrorDisplay
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):
Expand Down
4 changes: 0 additions & 4 deletions autoemulate/save.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion tests/models/test_cnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down

0 comments on commit b68c497

Please sign in to comment.