Skip to content

Update rmse.py - #29

Merged
fwitmer merged 3 commits into
fwitmer:devfrom
rawann31:dev
Jul 24, 2024
Merged

Update rmse.py#29
fwitmer merged 3 commits into
fwitmer:devfrom
rawann31:dev

Conversation

@rawann31

@rawann31 rawann31 commented Jul 20, 2024

Copy link
Copy Markdown
Collaborator

This pull request simplifies the RMSE calculation code and resolves an iteration issue related to MultiPoint objects. These updates improve the efficiency and accuracy of the RMSE calculations.

Contributions

1. Code Simplification

  • Updated RMSE Calculation: Simplified the code for calculating RMSE by addressing an iteration issue.

2. Resolved Iteration Issue

  • Problem: Originally, attempting to loop over fst (ground truth) and snd (predicted) without using .geoms resulted in a TypeError: 'MultiPoint' object is not iterable.
  • Solution:
    • Before:
      for point in fst:
          dist = point.distance(transect.geometry)
          if dist < epsilon:
              intersects[i]['fst'].append(point)
      
      for point in snd:
          dist = point.distance(transect.geometry)
          if dist < epsilon:
              intersects[i]['snd'].append(point)
    • After:
      fst_points = [point for point in fst.geoms if point.distance(transect_geom) < EPSILON]
      snd_points = [point for point in snd.geoms if point.distance(transect_geom) < EPSILON]

This pull request is part of Google Summer of Code 2024.

rawann31 added 3 commits July 20, 2024 05:22
Contributions:

 - Simplify the code of RMSE.

- Solve a problem in Code:
   To loop over fst and snd point , you need to apply .geoms to iterate over their individual geometries.

To run this script you need only to edit transects_lines_path, predicted_shp_path, true_shp_path.

You will get RMSE for all image and for each region of 4 regions.
Change transects function name

@fwitmer fwitmer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code significantly streamlined.

@fwitmer
fwitmer merged commit 49f774a into fwitmer:dev Jul 24, 2024
Ritika-K7 pushed a commit to Ritika-K7/CoastlineExtraction that referenced this pull request Aug 23, 2025
Update rmse.py with significantly streamlined code. Change get_transects function to calc_transects_rmse.
Ritika-K7 pushed a commit to Ritika-K7/CoastlineExtraction that referenced this pull request Aug 23, 2025
Update rmse.py with significantly streamlined code. Change get_transects function to calc_transects_rmse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants