diff --git a/modnet/__init__.py b/modnet/__init__.py index de49d1fa..32efefd0 100644 --- a/modnet/__init__.py +++ b/modnet/__init__.py @@ -1 +1 @@ -__version__ = "0.1.5" \ No newline at end of file +__version__ = "0.1.6" \ No newline at end of file diff --git a/modnet/models.py b/modnet/models.py index f54634b7..f92f49ad 100644 --- a/modnet/models.py +++ b/modnet/models.py @@ -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() @@ -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