?????????????????
???????????? ???????[ 2013/9/9 16:36:05 ] ????????
?????????以?????????????????????????????????????????ж???????????????????????
??????????????????5-10????????????????????????1??С????????????????? …
????8809=6
????7111=0
????2172=0
????6666=4
????1111=0
????3213=0
????7662=2
????9313=1
????0000=4
????2222=0
????3333=0
????5555=0
????8193=3
????8096=5
????7777=0
????9999=4
????7756=1
????6855=3
????9881=5
????5531=0
????2581=?
????????? …
????.
????.
????.
????.
????.
????.
????.
????.
????.
??????????????????ж???????й??????????8??2?????????????Ρ?0????????????1?Ρ?????2581=2?????????????????????????????????????ó???????????????????
???????????????????????????????????????????????????????????????????????????ü??????????????????????????????£?????????????????????????????????????????????????????????OLS(ordinary least squares)??????????????????????????????????????????漰????????????????СС??OLS????????????????е???????????????????????????????????????????8809=6??????????????????????????????????????
????1??0??0??0??0??0??0??0??2??1 = 6
??????????????????У?10?????????????????0-9??????????г?????????????????εó???????α???????????????????????????????????????????????????StackOverflow.com???????????????????????????????????????α????????????????????10?????????????????????
?????????????????——???????????????——????????Щ???????????????R??????????????С?
????## read in the training data
????## more lines than it should be because of the https requirement in Github
????temporaryFile <- tempfile()
????download.file("https://raw.github.com/gist/2061284/44a4dc9b304249e7ab3add86bc245b6be64d2cdd/problem.csv"??destfile=temporaryFile?? method="curl")
????series <- read.csv(temporaryFile)
????## munge the data to create a frequency table
????freqTable <- as.data.frame( t(apply(series[??1:4]?? 1?? function(X) table(c(X?? 0:9))-1)) )
????names(freqTable) <- c("zero"??"one"??"two"??"three"??"four"??"five"??"six"??"seven"??"eight"??"nine")
????freqTable$dep <- series[??5]
????## now a simple OLS regression with no intercept
????myModel <- lm(dep ~ 0 + zero + one + two + three + four + five + six + seven + eight + nine?? data=freqTable)
????round(myModel$coefficients)
????Created by Pretty R at inside-R.org
????????????????£?
????> round(myModel$coefficients)
????zero one two three four five six seven eight nine
????1 0 0 0 NA 0 1 0 2 1
??????????????0??6??9????????1????8????????2?????????????????0????4?ó?????NA?????????????????????г???4??
????????????????????????????????????????ó????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11