Skip to content

Commit

Permalink
refactor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ppdebreuck committed Sep 17, 2020
1 parent b68b9b4 commit 055787f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modnet/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.5"
__version__ = "0.1.6"
5 changes: 3 additions & 2 deletions modnet/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def __init__(self,targets,weights,num_neurons=[[64],[32],[16],[16]], n_feat=300,

def fit(self,data:MODData, val_fraction = 0.0, val_key = None, lr=0.001, epochs = 200, batch_size = 128, xscale='minmax',yscale=None):

print('new')
if self.n_feat > len(data.get_optimal_descriptors()):
raise RuntimeError("The model requires more features than computed in data. Please reduce n_feat below or equal to {}".format(len(data.get_optimal_descriptors())))
self.xscale = xscale
self.target_names = data.names
self.optimal_descriptors = data.get_optimal_descriptors()
Expand Down Expand Up @@ -137,7 +138,7 @@ def predict(self,data):
p = np.array(self.model.predict(x))[:,0].transpose()
predictions = pd.DataFrame(p)
predictions.columns = self.targets_flatten
predictions.index = data.ids
predictions.index = data.structure_ids

return predictions

Expand Down

0 comments on commit 055787f

Please sign in to comment.