menu_book Course Curriculum (Statistics) expand_more
Descriptive Statistics
Probability
Distributions
Sampling & Estimation
Hypothesis Testing
coefficient of determination R²
Learn coefficient of determination R² in Statistics with a dedicated explanation, a concept-specific example, practical cautions, and a mastery check.
12 min read
•
Advanced
Advertisement
statistics-045.py
python
y=[3,5,4,8]; pred=[2.5,5.5,4.5,7.5]
mean=sum(y)/len(y); ss_res=sum((a-b)**2 for a,b in zip(y,pred)); ss_tot=sum((a-mean)**2 for a in y)
print(1-ss_res/ss_tot)
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content