byu-hydroinformatics / hydroerr Goto Github PK
View Code? Open in Web Editor NEWGoodness of Fit metrics for use in comparison studies, specifically in the field of hydrology.
License: MIT License
Goodness of Fit metrics for use in comparison studies, specifically in the field of hydrology.
License: MIT License
I tried comparing the output of HydroErr's r_squared and nse with SKLearn's r2 score.
I found out that HydroErr's NSE and Sklearn's r2 scores are the same. Meanwhile HydroErr's R_squared is different from SKLearn's R2 score. Is this a bug? If not, can someone help me understand the reason for the discrepancy?
Below is a sample code:
from sklearn.metrics import r2_score
import HydroErr as he
y_true = [3, -0.5, 2, 7]
y_pred = [2.5, 0.0, 2, 8]
sklearn_r2 = r2_score(y_true=y_true, y_pred=y_pred)
hydroer_nse = he.nse(simulated_array=y_pred, observed_array=y_true)
hydroer_r2 = he.r_squared(simulated_array=y_pred, observed_array=y_true)
print("SKLearn R2: ", sklearn_r2)
print("HydroErr NSE: ", hydroer_nse)
print("HydroErr R2: ", hydroer_r2)
# # Output ##
# SKLearn R2: 0.9486081370449679
# HydroErr NSE: 0.9486081370449679
# HydroErr R2: 0.9699681653424412
As you can see above, SKLearn's R2 and HydroErr's NSE are the exact same.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.