Spaces:
Sleeping
Sleeping
Eachan Johnson commited on
Commit ·
756d4d1
1
Parent(s): ac04716
Fix file prediction
Browse files197 unmodified lines1981992002012022034 unmodified lines2082092102112122132142152162176 unmodified lines2242252262272282291 unmodified line231232233234235236237197 unmodified linesspecies_to_predict = cast(predict, to=list)prediction_cols = []for species in species_to_predict:this_modelbox = MODELBOXES[species]this_features = this_modelbox._input_colsthis_labels = this_modelbox._label_cols4 unmodified lines}).assign(**{label: np.nan for label in this_labels}))prediction = this_modelbox.predict(data=this_prediction_input,features=this_features,labels=this_labels,cache="./cache").with_format("numpy")["__prediction__"].flatten()print(prediction)6 unmodified linesthis_col = f"{species}: {extra_metric}"prediction_cols.append(this_col)print(">>>", this_modelbox._input_training_data)this_extra = (EXTRA_METRICS[extra_metric](this_modelbox,1 unmodified line).with_format("numpy"))prediction_df[this_col] = this_extra[this_extra.column_names[0]]return prediction_df[['id'] + prediction_cols + ['smiles', 'inchikey', "mwt", "clogp"]]197 unmodified lines1981992002012022032042052064 unmodified lines2112122132142152162172182192202212226 unmodified lines2292302312322332342352361 unmodified line238239240241242243244197 unmodified linesspecies_to_predict = cast(predict, to=list)prediction_cols = []for species in species_to_predict:message = f"Predicting for species: {species}"print_err(message)gr.Info(message, duration=3)this_modelbox = MODELBOXES[species]this_features = this_modelbox._input_colsthis_labels = this_modelbox._label_cols4 unmodified lines}).assign(**{label: np.nan for label in this_labels}))print(this_prediction_input)prediction = this_modelbox.predict(data=this_prediction_input,features=this_features,labels=this_labels,aggregator="mean",cache="./cache").with_format("numpy")["__prediction__"].flatten()print(prediction)6 unmodified linesthis_col = f"{species}: {extra_metric}"prediction_cols.append(this_col)print(">>>", this_modelbox._input_training_data)print(">>>", this_modelbox._input_training_data.format)print(">>>", this_modelbox._in_key, this_modelbox._out_key)this_extra = (EXTRA_METRICS[extra_metric](this_modelbox,1 unmodified line).with_format("numpy"))prediction_df[this_col] = this_extra[this_extra.column_names[-1]]return prediction_df[['id'] + prediction_cols + ['smiles', 'inchikey', "mwt", "clogp"]]
app.py+8-1