Skip to content

Commit 4dcea74

Browse files
authored
Merge pull request #951 from Satyam-madeit/fix/my-first-contribution
fix: correct accuracy row alignment in classification report table
2 parents 6de2f03 + 62fe8a3 commit 4dcea74

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

2-Regression/3-Linear/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,13 @@ lin_reg.fit(X_train,y_train)
207207

208208
The `LinearRegression` object after `fit`-ting contains all the coefficients of the regression, which can be accessed using `.coef_` property. In our case, there is just one coefficient, which should be around `-0.017`. It means that prices seem to drop a bit with time, but not too much, around 2 cents per day. We can also access the intersection point of the regression with Y-axis using `lin_reg.intercept_` - it will be around `21` in our case, indicating the price at the beginning of the year.
209209

210-
To see how accurate our model is, we can predict prices on a test dataset, and then measure how close our predictions are to the expected values. This can be done using mean square error (MSE) metrics, which is the mean of all squared differences between expected and predicted value.
210+
To see how accurate our model is, we can predict prices on a test dataset, and then measure how close our predictions are to the expected values. This can be done using root mean square error (RMSE) metrics, which is the root of the mean of all squared differences between expected and predicted value.
211211

212212
```python
213213
pred = lin_reg.predict(X_test)
214214

215-
mse = np.sqrt(mean_squared_error(y_test,pred))
216-
print(f'Mean error: {mse:3.3} ({mse/np.mean(pred)*100:3.3}%)')
215+
rmse = np.sqrt(mean_squared_error(y_test,pred))
216+
print(f'RMSE: {rmse:3.3} ({rmse/np.mean(pred)*100:3.3}%)')
217217
```
218218

219219
Our error seems to be around 2 points, which is ~17%. Not too good. Another indicator of model quality is the **coefficient of determination**, which can be obtained like this:

4-Classification/2-Classifiers-1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Since you are using the multiclass case, you need to choose what _scheme_ to use
223223
| japanese | 0.70 | 0.75 | 0.72 | 220 |
224224
| korean | 0.86 | 0.76 | 0.81 | 242 |
225225
| thai | 0.79 | 0.85 | 0.82 | 254 |
226-
| accuracy | 0.80 | 1199 | | |
226+
| accuracy | | | 0.80 | 1199 |
227227
| macro avg | 0.80 | 0.80 | 0.80 | 1199 |
228228
| weighted avg | 0.80 | 0.80 | 0.80 | 1199 |
229229

0 commit comments

Comments
 (0)