Skip to content

Commit

Permalink
fixed missing distl
Browse files Browse the repository at this point in the history
made scikit-learn a soft dependency as well
  • Loading branch information
gecheline committed May 3, 2022
1 parent ce4d502 commit a8de34c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
14 changes: 10 additions & 4 deletions ligeor/ebai/ebai.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import numpy as np
import warnings
from sklearn.neighbors import KNeighborsRegressor
from sklearn.neural_network import MLPRegressor
import matplotlib.pyplot as plt
from sklearn.preprocessing import MinMaxScaler
plt.style.use('science')
from scipy.interpolate import interp1d
from sklearn.model_selection import GridSearchCV

try:
import cmasher as cmr
_use_cmr = True
except:
_use_cmr = False

try:
from sklearn.preprocessing import MinMaxScaler
from sklearn.neighbors import KNeighborsRegressor
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import GridSearchCV
except:
raise ImportError('scikit-learn needs to be installed to run EBAI.')


class Ebai():

def __init__(self, model=None, model_type='knn',
Expand Down
5 changes: 4 additions & 1 deletion ligeor/utils/processing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import numpy as np
import distl
try:
import distl
except:
raise ImportError('distl needs to be installed for sampling distributions.')


def sample_skewed_gaussian(mean, sigma_low, sigma_high, size=1000):
Expand Down
Empty file added tests/test_ebai.py
Empty file.

0 comments on commit a8de34c

Please sign in to comment.