Description Usage Arguments Value Examples
Generate a multi-dimensional star tree data that contain
n_samples
data points and fit a star tree with n_arms
arms.
1 | generate_n_arms_star_data(n_features, n_samples, n_arms, fatness)
|
n_features |
The number of features (dimensions) to be generated. |
n_samples |
The number of samples to be generated. |
n_arms |
The number of arms to be generated. |
fatness |
How fat from the based star tree. |
A generated martix
. The rows and columns correspond to
samples and features.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Generate a 100-dimensional star tree data that contain 500 data points
# and fit a star tree with 3 arms. The generated data are a bit noisy but
# tree-like.
star100.tree_like <- treefit::generate_n_arms_star_data(100, 500, 3, 0.1)
# Reduce dimension to visualize.
star3.tree_like = prcomp(star100.tree_like, rank.=3)$x
plotly::plot_ly(data.frame(star3.tree_like),
x=~PC1,
y=~PC2,
z=~PC3,
type="scatter3d",
mode="markers",
marker=list(size=1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.