Skip to content

Commit

Permalink
clean up comments and spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchest authored Sep 30, 2024
1 parent c50ff73 commit a6e937f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Tools/dea_tools/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def _predict_func(model, input_xr, persist, proba, max_proba, clean, return_inpu
print(" probabilities...")
out_proba = model.predict_proba(input_data_flattened)

# convert to %
# return either one band with the max probability, or the whole probability array
if max_proba == True:
print(" returning single probability band.")
out_proba = da.max(out_proba, axis=1) * 100.0
Expand All @@ -348,12 +348,10 @@ def _predict_func(model, input_xr, persist, proba, max_proba, clean, return_inpu
else:
print(" returning class probability array.")
out_proba = out_proba * 100.0

class_names = model.classes_ # Get the unique class names from the fitted classifier

probabilities_dataset = xr.Dataset()

# Loop through each class (band)
probabilities_dataset = xr.Dataset()
for i, class_name in enumerate(class_names):
reshaped_band = out_proba[:, i].reshape(len(y), len(x))
reshaped_da = xr.DataArray(
Expand Down

0 comments on commit a6e937f

Please sign in to comment.