Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import itertools
import importlib
import json
from sklearn.ensemble import RandomForestRegressor
from sklearn.neural_network import MLPRegressor
from sklearn.metrics import r2_score, mean_squared_error
from sklearn.model_selection import train_test_split, RandomizedSearchCV
from sklearn.preprocessing import StandardScaler
import warnings
warnings.simplefilter("ignore")
class Model(Estimator, LogMixin):
# default meta-algorithm
META_ALGO = 'RF'
# the drop rate is used to fit the meta-algo on random parameters
DROP_RATE = 0.9
# the default estimated algorithm is a Random Forest from sklearn
ALGO = 'RandomForestRegressor'
def __init__(self, drop_rate=DROP_RATE,
meta_algo=META_ALGO, algo=ALGO, verbose=0, bins=None):
# the end user will estimate the fitting time
# of self.algo using the package
super().__init__(bins)
self.algo = algo
self.drop_rate = drop_rate
self.meta_algo = meta_algo
self.verbose = verbose