Skip to content

Commit

Permalink
fix #287
Browse files Browse the repository at this point in the history
  • Loading branch information
lacava committed Aug 16, 2023
1 parent 3013edf commit cc233ae
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion algorithms/feat/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
git clone https://github.com/cavalab/feat.git
cd feat
# fix version
git checkout tags/0.5.1
# git checkout tags/0.5.1
# install
pip install .
4 changes: 2 additions & 2 deletions algorithms/feat/regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
max_depth=6,
verbosity=2,
batch_size=100,
functions ='+,-,*,/,^2,^3,sqrt,sin,cos,exp,log',
functions=['+','-','*','/','^2','^3','sqrt','sin','cos','exp','log'],
otype='f'
)
# want to tune your estimator? wrap it in a sklearn CV class.
Expand Down Expand Up @@ -58,7 +58,7 @@ def model(est, X):

# Here we replace "|" with "" to handle
# protecte sqrt (expressed as sqrt(|.|)) in FEAT)
model_str = est.get_eqn()
model_str = est.cfeat_.get_eqn()
model_str = model_str.replace('|','')

# use python syntax for exponents
Expand Down
5 changes: 4 additions & 1 deletion algorithms/itea/regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@
def complexity(e):
return e.len

def model(e):
def model(e, X):
new_model = est.expr
for i,f in reversed(list(enumerate(X.columns))):
new_model = new_model.replace(f'x[:,{i}]',f)
return e.expr
2 changes: 1 addition & 1 deletion experiment/evaluate_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def evaluate_model(
##################################################
# Fit models
##################################################
print('X_train:',X_train_scaled.shape)
print('X_train:',type(X_train_scaled),X_train_scaled.shape)
print('y_train:',y_train_scaled.shape)
print('training',est)
t0t = time.time()
Expand Down
2 changes: 1 addition & 1 deletion local_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ echo "........................................"
conda activate $SUBENV
conda env list
conda info
python -m pytest -v test_evaluate_model.py --ml $SUBNAME
python -m pytest -v test_algorithm.py --ml $SUBNAME

# Store Competitor
# cd ..
Expand Down

0 comments on commit cc233ae

Please sign in to comment.