Comments (6)
@panoptikum Hello, I have used your function CreateNodes() to create nodes, but got into the debug mode. Then I tried your function hts(), also got into the debug mode. Could you give a detail example? Thanks.
from hts.
@jnuvenus Thanks for trying out my function. I forgot to remove a browser() within the function which was there for debug purposes. It should work with the above example now, but I can highlight the crucial code changes as well.
You have to source the whole hts.R file to ensure functionality or load my fork of HTS.
Let me know, if it works or not.
from hts.
@panoptikum Finally, I use hive sql to calculate the num of every level of the nodes, and then use R arrange() fun to sort them。
from hts.
@jnuvenus Well, I'm sure others would like to stay within R and this package, but I'm pleased to hear that you've found a working solution for you.
from hts.
@panoptikum Hello, I use CreateNodes() in your new hts() function,
cols <- c('yCN01_y755Y_y755AC','yCN01_y755Y_y755AG','yCN01_y023Y_y023Y00001','yCN02_y010A_y010AAC')
gtnode <- CreateNodes(bnames=cols, characters = c(1, 2, 1), sep="_")$nodes
then, I got result as follows,
[[1]]
[1] 2
[[2]]
yCN01 yCN02
3 1
[[3]]
yCN01y755Y yCN01y023Y yCN02y010A
2 1 1
This result have one error, the num of yCN01 should be 2.
So, I fixed the bug in cnt count part in your CreateNodes() ,
cnt <- sapply(x_1, function(z) {
vec1 <- sapply(bnames_split, function(i) {paste(c(paste(i[1:(x-1)], collapse = ""),i[x]), collapse = "")})
vec1 <- unique(vec1)
vec <- sapply(vec1, function(j){strsplit( j,"")[[1]][1]==z})
sum(vec, na.rm = TRUE)
})
then I got result as follows,
[[1]]
[1] 2
[[2]]
yCN01 yCN02
2 1
[[3]]
yCN01y755Y yCN01y023Y yCN02y010A
2 1 1
Maybe you can try this fix on other examples.
from hts.
Is there any news in terms of this functionality?
I agree, it's so painful to prepare groups. I had to write some functions that make new column in a DF as a key with fixed length where it defines the length of each group.
If I have 3 groups it finds max symbol length of each column and add some symbols in the end of each row so that it has the same length as the longest in the column. Then it concatinates 3 colums, Pivot by the concatinated key to columns and passes to HTS also giving the length of each group (max character length).
from hts.
Related Issues (20)
- MinT: Error in if (!is.symmetric.matrix(x)) stop("argument x is not a symmetric matrix") : missing value where TRUE/FALSE needed HOT 1
- MinT needs covariance matrix to be positive definite. HOT 9
- parallel doesnt work on custom functions HOT 2
- Implement Hyndman's fix for non conforming forecast
- Issue with gts
- Error in install.packages : cannot open the connection HOT 1
- Predictions are always flat? HOT 8
- Interop with tidyverts HOT 6
- Warning message if constant columns are passed to MinT
- Getting fitted and residual values when using comb nonnegative method
- How to work on a single level hierarchy?
- hts cannot create a hierarchical time series for a single observation HOT 1
- A typo in the code causes error when calling forecast.gts() with nonnegative=T parameter HOT 1
- Missing nodes (time-series) in hierarchy: combinef reconciliation function error HOT 2
- combinef function to constrain bottom level predictions with external predictions in gts
- Sample covariance calculation HOT 2
- Failed to install 'hts' due to RcppEigen.h
- forecast.gts argument conflicts with auto.arima via ... HOT 1
- Add support for RMSSE metric
- Error with hts forecasting with 2 levels HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hts.