Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env[[m]] in ahistory #269

Closed
MarcinKosinski opened this issue Jun 7, 2016 · 5 comments
Closed

env[[m]] in ahistory #269

MarcinKosinski opened this issue Jun 7, 2016 · 5 comments

Comments

@MarcinKosinski
Copy link
Collaborator

MarcinKosinski commented Jun 7, 2016

@pbiecek have you seen ahistory calls here http://r-addict.com/archivist.github/#32_partial_results_archiving_and_objects%E2%80%99_pedigree_restoration ?

I think this is the result of improving such snippets with asearch

mm <- asearch(patterns = c('class:lm',
                     'coefname:Speciesversicolor'),
        repo = 'pbiecek/graphGallery')

mm %>%
  lapply(function(x) {
    c(r.squared = summary(x)$r.squared,
      x$coef) %>%
      # extract coeffs and R-squared statistic
      t %>%
      as.data.frame # transpose for binding
  }) %>% 
  do.call(dplyr::bind_rows, .) %>% # apply bind_rows to all list elements
  cbind(data.frame(md5hash = names(mm))) %>%
  arrange(r.squared) %>% # arrange rows by r.squared
    unique() %>%
        select(-Sepal.Length) # to fit in the output html

  r.squared (Intercept) Speciesversicolor Speciesvirginica                          md5hash
1 0.6187057    5.006000          0.930000         1.582000 0e213ac68a45b6cd454d06b91f991bc7
2 0.6187057    5.006000          0.930000         1.582000 e58d2f9d50b67ce4d397bf015ec1259c
3 0.9413717    1.462000          2.798000         4.090000 0a82efeb8250a47718cea9d7f64e5ae7
4 0.9413717    1.462000          2.798000         4.090000 378237103bb60c58600fe69bed6c7f11
5 0.9413717    1.462000          2.798000         4.090000 7f11e03539d48d35f7e7fe7780527ba7
6 0.9413717    1.462000          2.798000         4.090000 c1b1ef7bcddefb181f79176015bc3931
7 0.9604273    1.462000          2.507231         3.509429 990861c7c27812ee959f10e5f76fe2c3
8 0.9748944   -1.702342          2.210138         3.090002 2a6e492cb6982f230e48cf46023e2e4f

to have md5hash column

should we fix ahistory to now show the row with env[[m]] ?

@pbiecek
Copy link
Owner

pbiecek commented Jun 8, 2016

I am not sure if I am following,
there is a row with env[[m]] in ahistory() calls.
Is it like you would like to use a real name for data source instead of '
env[[m]]'?
If so it is worth to fix. I notices this a week ago during classes about
archivist. But have not dig this dipper.

If there is a different concern let me know.

2016-06-07 23:15 GMT+02:00 Marcin Kosiński [email protected]:

@pbiecek https://github.com/pbiecek have you seen ahistory calls here
http://r-addict.com/archivist.github/#32_partial_results_archiving_and_objects%E2%80%99_pedigree_restoration
?

I think this is the result of improving such snippets with asearch

mm <- asearch(patterns = c('class:lm',
'coefname:Speciesversicolor'),
repo = 'pbiecek/graphGallery')
mm %>%
lapply(function(x) {
c(r.squared = summary(x)$r.squared,
x$coef) %>%
# extract coeffs and R-squared statistic
t %>%
as.data.frame # transpose for binding
}) %>%
do.call(dplyr::bind_rows, .) %>% # apply bind_rows to all list elements
cbind(data.frame(md5hash = names(mm))) %>%
arrange(r.squared) %>% # arrange rows by r.squared
unique() %>%
select(-Sepal.Length) # to fit in the output html

r.squared (Intercept) Speciesversicolor Speciesvirginica md5hash1 0.6187057 5.006000 0.930000 1.582000 0e213ac68a45b6cd454d06b91f991bc72 0.6187057 5.006000 0.930000 1.582000 e58d2f9d50b67ce4d397bf015ec1259c3 0.9413717 1.462000 2.798000 4.090000 0a82efeb8250a47718cea9d7f64e5ae74 0.9413717 1.462000 2.798000 4.090000 378237103bb60c58600fe69bed6c7f115 0.9413717 1.462000 2.798000 4.090000 7f11e03539d48d35f7e7fe7780527ba76 0.9413717 1.462000 2.798000 4.090000 c1b1ef7bcddefb181f79176015bc39317 0.9604273 1.462000 2.507231 3.509429 990861c7c27812ee959f10e5f76fe2c38 0.9748944 -1.702342 2.210138 3.090002 2a6e492cb6982f230e48cf46023e2e4f

to have md5hash column

should we fix ahistory to now show the row with env[[m]] ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#269, or mute the thread
https://github.com/notifications/unsubscribe/AEaPvhKT7qBDkKtDHDfmyiVJ_eGmCS0Bks5qJd96gaJpZM4IwXlT
.

pozdrawiam serdecznie,
Przemysław Biecek

@MarcinKosinski
Copy link
Collaborator Author

This happened after changes in asearch. I think it's due to this commit
f60cb84#diff-7d4d94dc087a02fd4a6007a348097330
but ahistory does not use asearch so I might be wrong :P
I've noticed this long ago.

We should remove this row in ahistory or substitute env[[m]] with an
artifact's name

2016-06-08 10:03 GMT+02:00 Przemysław Biecek [email protected]:

I am not sure if I am following,
there is a row with env[[m]] in ahistory() calls.
Is it like you would like to use a real name for data source instead of '
env[[m]]'?
If so it is worth to fix. I notices this a week ago during classes about
archivist. But have not dig this dipper.

If there is a different concern let me know.

2016-06-07 23:15 GMT+02:00 Marcin Kosiński [email protected]:

@pbiecek https://github.com/pbiecek have you seen ahistory calls here

http://r-addict.com/archivist.github/#32_partial_results_archiving_and_objects%E2%80%99_pedigree_restoration
?

I think this is the result of improving such snippets with asearch

mm <- asearch(patterns = c('class:lm',
'coefname:Speciesversicolor'),
repo = 'pbiecek/graphGallery')
mm %>%
lapply(function(x) {
c(r.squared = summary(x)$r.squared,
x$coef) %>%

extract coeffs and R-squared statistic

t %>%
as.data.frame # transpose for binding
}) %>%
do.call(dplyr::bind_rows, .) %>% # apply bind_rows to all list elements
cbind(data.frame(md5hash = names(mm))) %>%
arrange(r.squared) %>% # arrange rows by r.squared
unique() %>%
select(-Sepal.Length) # to fit in the output html

r.squared (Intercept) Speciesversicolor Speciesvirginica md5hash1
0.6187057 5.006000 0.930000 1.582000 0e213ac68a45b6cd454d06b91f991bc72
0.6187057 5.006000 0.930000 1.582000 e58d2f9d50b67ce4d397bf015ec1259c3
0.9413717 1.462000 2.798000 4.090000 0a82efeb8250a47718cea9d7f64e5ae74
0.9413717 1.462000 2.798000 4.090000 378237103bb60c58600fe69bed6c7f115
0.9413717 1.462000 2.798000 4.090000 7f11e03539d48d35f7e7fe7780527ba76
0.9413717 1.462000 2.798000 4.090000 c1b1ef7bcddefb181f79176015bc39317
0.9604273 1.462000 2.507231 3.509429 990861c7c27812ee959f10e5f76fe2c38
0.9748944 -1.702342 2.210138 3.090002 2a6e492cb6982f230e48cf46023e2e4f

to have md5hash column

should we fix ahistory to now show the row with env[[m]] ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#269, or mute the thread
<
https://github.com/notifications/unsubscribe/AEaPvhKT7qBDkKtDHDfmyiVJ_eGmCS0Bks5qJd96gaJpZM4IwXlT

.

pozdrawiam serdecznie,
Przemysław Biecek


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#269 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AGdazrDwVpjiJctpo9o8cXm7Au9sTsMmks5qJndSgaJpZM4IwXlT
.

@pbiecek
Copy link
Owner

pbiecek commented Jun 9, 2016

I thinik we should substitute this with original name,
but how to do this

2016-06-08 11:32 GMT+02:00 Marcin Kosiński [email protected]:

This happened after changes in asearch. I think it's due to this commit

f60cb84#diff-7d4d94dc087a02fd4a6007a348097330
but ahistory does not use asearch so I might be wrong :P
I've noticed this long ago.

We should remove this row in ahistory or substitute env[[m]] with an
artifact's name

2016-06-08 10:03 GMT+02:00 Przemysław Biecek [email protected]:

I am not sure if I am following,
there is a row with env[[m]] in ahistory() calls.
Is it like you would like to use a real name for data source instead of '
env[[m]]'?
If so it is worth to fix. I notices this a week ago during classes about
archivist. But have not dig this dipper.

If there is a different concern let me know.

2016-06-07 23:15 GMT+02:00 Marcin Kosiński [email protected]:

@pbiecek https://github.com/pbiecek have you seen ahistory calls
here

http://r-addict.com/archivist.github/#32_partial_results_archiving_and_objects%E2%80%99_pedigree_restoration

?

I think this is the result of improving such snippets with asearch

mm <- asearch(patterns = c('class:lm',
'coefname:Speciesversicolor'),
repo = 'pbiecek/graphGallery')
mm %>%
lapply(function(x) {
c(r.squared = summary(x)$r.squared,
x$coef) %>%

extract coeffs and R-squared statistic

t %>%
as.data.frame # transpose for binding
}) %>%
do.call(dplyr::bind_rows, .) %>% # apply bind_rows to all list elements
cbind(data.frame(md5hash = names(mm))) %>%
arrange(r.squared) %>% # arrange rows by r.squared
unique() %>%
select(-Sepal.Length) # to fit in the output html

r.squared (Intercept) Speciesversicolor Speciesvirginica md5hash1
0.6187057 5.006000 0.930000 1.582000 0e213ac68a45b6cd454d06b91f991bc72
0.6187057 5.006000 0.930000 1.582000 e58d2f9d50b67ce4d397bf015ec1259c3
0.9413717 1.462000 2.798000 4.090000 0a82efeb8250a47718cea9d7f64e5ae74
0.9413717 1.462000 2.798000 4.090000 378237103bb60c58600fe69bed6c7f115
0.9413717 1.462000 2.798000 4.090000 7f11e03539d48d35f7e7fe7780527ba76
0.9413717 1.462000 2.798000 4.090000 c1b1ef7bcddefb181f79176015bc39317
0.9604273 1.462000 2.507231 3.509429 990861c7c27812ee959f10e5f76fe2c38
0.9748944 -1.702342 2.210138 3.090002 2a6e492cb6982f230e48cf46023e2e4f

to have md5hash column

should we fix ahistory to now show the row with env[[m]] ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#269, or mute the thread
<

https://github.com/notifications/unsubscribe/AEaPvhKT7qBDkKtDHDfmyiVJ_eGmCS0Bks5qJd96gaJpZM4IwXlT

.

pozdrawiam serdecznie,
Przemysław Biecek


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#269 (comment)
,
or mute the thread
<
https://github.com/notifications/unsubscribe/AGdazrDwVpjiJctpo9o8cXm7Au9sTsMmks5qJndSgaJpZM4IwXlT

.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#269 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEaPvlimWxCb6YywKwAHWn0d_p21j6dxks5qJow8gaJpZM4IwXlT
.

pozdrawiam serdecznie,
Przemysław Biecek

@MarcinKosinski
Copy link
Collaborator Author

Thi env[[m]] looks like this line
https://github.com/pbiecek/archivist/blob/master/R/magrittr.R#L95

I'll go deeper

@MarcinKosinski
Copy link
Collaborator Author

Ok it was easier than I thought. It was the case that we used remeberName = FALSE argument in saveToRepo which we have probably removed. Not it is artifactName where one can pass original name after deparse(substitute())

Example :

> createLocalRepo("ahistory_check", default = TRUE)
Directory ahistory_check did not exist. Forced to create a new directory.
> library(dplyr)
> iris %a%
+ filter(Sepal.Length < 6) %a%
+  lm(Petal.Length~Species, data=.) %a%
+  summary() -> artifact
>  
> ahistory(artifact)
   iris                                  [ff575c261c949d073b2895b05d1097c3]
-> filter(Sepal.Length < 6)              [d3696e13d15223c7d0bbccb33cc20a11]
-> lm(Petal.Length ~ Species, data = .)  [802857dee508b128b26564e6b9519bb1]
-> summary()                             [4e34b66ecaa7fc9f13c2aad4edd042f8]
> 
> splitTagsLocal() %>% 
+   select(-createdDate) %>%
+   filter(tagKey == "name") %>%
+   arrange(artifact)
                          artifact tagKey
1 4e34b66ecaa7fc9f13c2aad4edd042f8   name
2 802857dee508b128b26564e6b9519bb1   name
3 802857dee508b128b26564e6b9519bb1   name
4 d3696e13d15223c7d0bbccb33cc20a11   name
5 d3696e13d15223c7d0bbccb33cc20a11   name
6 ff575c261c949d073b2895b05d1097c3   name
                                                                        tagValue
1                                                                        res_val
2                                                                        res_val
3 iris %a% filter(Sepal.Length < 6) %a% lm(Petal.Length ~ Species,     data = .)
4                                                                        res_val
5                                              iris %a% filter(Sepal.Length < 6)
6                                                                           iris

I am not sure whether additional name res_val is needed :) but this is closed and NEWS are updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants