gradient_descent
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| gradient_descent [2026/03/14 10:46] – [Gradient Descent] hkimscil | gradient_descent [2026/03/14 11:21] (current) – [output] hkimscil | ||
|---|---|---|---|
| Line 313: | Line 313: | ||
| > # we use sum of square of error which oftentimes become big | > # we use sum of square of error which oftentimes become big | ||
| > msrloss <- function(predictions, | > msrloss <- function(predictions, | ||
| - | + | + | + |
| - | + | + | + |
| + } | + } | ||
| > | > | ||
| Line 322: | Line 322: | ||
| > | > | ||
| > for (i in seq(from = -50, to = 50, by = 0.01)) { | > for (i in seq(from = -50, to = 50, by = 0.01)) { | ||
| - | + | + | + |
| - | + | + | + |
| - | + | + | + |
| - | + | + | + |
| - | + | + | + |
| - | + | + | + |
| + } | + } | ||
| > length(msrs) | > length(msrs) | ||
| Line 337: | Line 337: | ||
| > | > | ||
| > min(msrs) | > min(msrs) | ||
| - | [1] 7766.679 | + | [1] 8735.055 |
| > min.pos.msrs <- which(msrs == min(msrs)) | > min.pos.msrs <- which(msrs == min(msrs)) | ||
| > min.pos.msrs | > min.pos.msrs | ||
| - | [1] 5828 | + | [1] 4896 |
| > print(as[min.pos.msrs]) | > print(as[min.pos.msrs]) | ||
| - | [1] 8.27 | + | [1] -1.05 |
| > summary(mo) | > summary(mo) | ||
| Line 350: | Line 350: | ||
| Residuals: | Residuals: | ||
| | | ||
| - | -259.314 -59.215 6.683 | + | -245.291 -67.967 -3.722 |
| Coefficients: | Coefficients: | ||
| Estimate Std. Error t value Pr(> | Estimate Std. Error t value Pr(> | ||
| - | (Intercept) | + | (Intercept) |
| - | x 11.888 2.433 4.887 2.11e-06 *** | + | x 12.900 2.870 4.495 1.19e-05 *** |
| --- | --- | ||
| Signif. codes: | Signif. codes: | ||
| - | Residual standard error: | + | Residual standard error: |
| - | Multiple R-squared: | + | Multiple R-squared: |
| - | F-statistic: | + | F-statistic: |
| > plot(seq(1, length(msrs)), | > plot(seq(1, length(msrs)), | ||
| > plot(seq(1, length(srs)), | > plot(seq(1, length(srs)), | ||
| > tail(msrs) | > tail(msrs) | ||
| - | [1] 9504.208 9505.041 9505.875 9506.710 9507.544 9508.379 | + | [1] 11335.75 11336.77 11337.79 11338.81 11339.84 11340.86 |
| > max(msrs) | > max(msrs) | ||
| - | [1] 11161.64 | + | [1] 11340.86 |
| > min(msrs) | > min(msrs) | ||
| - | [1] 7766.679 | + | [1] 8735.055 |
| > tail(srs) | > tail(srs) | ||
| - | [1] -41.68368 -41.69368 -41.70368 -41.71368 -41.72368 -41.73368 | + | [1] -50.99705 -51.00705 -51.01705 -51.02705 -51.03705 -51.04705 |
| > max(srs) | > max(srs) | ||
| - | [1] 58.26632 | + | [1] 48.95295 |
| > min(srs) | > min(srs) | ||
| - | [1] -41.73368 | + | [1] -51.04705 |
| - | > | + | > |
| </ | </ | ||
| - | {{: | + | {{pasted:20260314-112129.png}} |
| - | {{:pasted:20250821-121024.png}} | + | |
| ===== b값 구하기 ===== | ===== b값 구하기 ===== | ||
gradient_descent.1773485215.txt.gz · Last modified: by hkimscil
