diff --git a/learnware/reuse/ensemble_pruning.py b/learnware/reuse/ensemble_pruning.py index d20664c..ab86c66 100644 --- a/learnware/reuse/ensemble_pruning.py +++ b/learnware/reuse/ensemble_pruning.py @@ -1,8 +1,6 @@ import torch import random import numpy as np -import geatpy as ea - from typing import List from learnware.learnware import Learnware @@ -55,6 +53,8 @@ class EnsemblePruningReuser(BaseReuser): np.ndarray Binary one-dimensional vector, 1 indicates that the corresponding model is selected. """ + import geatpy as ea + model_num = v_predict.shape[1] @ea.Problem.single @@ -139,6 +139,8 @@ class EnsemblePruningReuser(BaseReuser): np.ndarray Binary one-dimensional vector, 1 indicates that the corresponding model is selected. """ + import geatpy as ea + model_num = v_predict.shape[1] def find_top_two_freq(row): @@ -253,6 +255,8 @@ class EnsemblePruningReuser(BaseReuser): np.ndarray Binary one-dimensional vector, 1 indicates that the corresponding model is selected. """ + import geatpy as ea + model_num = v_predict.shape[1] v_predict[v_predict == 0.0] = -1 v_true[v_true == 0.0] = -1 diff --git a/setup.py b/setup.py index 05c9681..7144375 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,6 @@ REQUIRED = [ "numpy>=1.20.0", "pandas>=0.25.1", "scipy>=1.0.0", - "matplotlib>=3.1.3", "torch>=1.11.0", "cvxopt>=1.3.0", "tqdm>=4.65.0", @@ -67,7 +66,6 @@ REQUIRED = [ "torchvision>=0.14.1", "sqlalchemy>=2.0.21", "shortuuid>=1.0.11", - "geatpy>=2.7.0", "docker>=6.1.3", "rapidfuzz>=3.4.0", "sentence_transformers>=2.2.2",