Skip to content

Commit

Permalink
Update supervised.py to resolve SettingWithCopyWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahshi committed May 28, 2024
1 parent 75f4d3b commit 90fb446
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mineralML/supervised.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def norm_data_nn(df):
# scaled_df = df[oxides].reset_index(drop=True).copy()

if df[oxides].isnull().any().any():
df, _ = prep_df_nn(df)
df = prep_df_nn(df)
else:
df = df

Expand Down Expand Up @@ -528,10 +528,10 @@ def predict_class_prob_nn(df, n_iterations=250):
first_predict_mineral = class2mineral_nn(top_two_indices[:, 1])
second_predict_mineral = class2mineral_nn(top_two_indices[:, 0])

df["Predict_Mineral"] = first_predict_mineral
df["Predict_Probability"] = first_predict_prob
df["Second_Predict_Mineral"] = second_predict_mineral
df["Second_Predict_Probability"] = second_predict_prob
df.loc[:, "Predict_Mineral"] = first_predict_mineral
df.loc[:, "Predict_Probability"] = first_predict_prob
df.loc[:, "Second_Predict_Mineral"] = second_predict_mineral
df.loc[:, "Second_Predict_Probability"] = second_predict_prob

return df, probability_matrix

Expand Down

0 comments on commit 90fb446

Please sign in to comment.