-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix predict for cluster centers in vis-recipe
- Loading branch information
1 parent
c28bdd0
commit 189cf82
Showing
4 changed files
with
82 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# vis_recipe.cluster_analysis | ||
|
||
Code | ||
print(out) | ||
Output | ||
Layer 1 | ||
-------- | ||
Geom type: text | ||
data = [150 x 4] | ||
aes_string( | ||
x = 'x' | ||
y = 'y' | ||
label = 'label' | ||
color = 'Cluster' | ||
) | ||
Layer 2 | ||
-------- | ||
Geom type: point | ||
data = [4 x 3] | ||
aes_string( | ||
x = 'x' | ||
y = 'y' | ||
color = 'Cluster' | ||
) | ||
shape = '+' | ||
size = 10 | ||
Layer 3 | ||
-------- | ||
Geom type: labs | ||
x = 'PCA - 1' | ||
y = 'PCA - 2' | ||
title = 'Clustering Solution' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
test_that("vis_recipe.cluster_analysis", { | ||
data(iris) | ||
result <- cluster_analysis(iris[, 1:4], n = 4) | ||
out <- visualisation_recipe(result) | ||
expect_named(out, c("l1", "l2", "l3")) | ||
expect_s3_class(out, "visualisation_recipe") | ||
expect_snapshot(print(out)) | ||
}) |