Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ENS M1 ML
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ghislain Durif
ENS M1 ML
Commits
95129a51
Verified
Commit
95129a51
authored
2 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
reveal some figures in practicals with echo=F
parent
1b814878
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Practical_a.Rmd
+6
-6
6 additions, 6 deletions
Practical_a.Rmd
Practical_b.Rmd
+3
-3
3 additions, 3 deletions
Practical_b.Rmd
with
9 additions
and
9 deletions
Practical_a.Rmd
+
6
−
6
View file @
95129a51
...
@@ -437,7 +437,7 @@ To obtain the following figure you will need to write the body of the `point_pro
...
@@ -437,7 +437,7 @@ To obtain the following figure you will need to write the body of the `point_pro
Then you will need to compute the `slope` value for the `geom_abline` function from the `diy_cov` results.
Then you will need to compute the `slope` value for the `geom_abline` function from the `diy_cov` results.
</div>
</div>
```{r
include=FALSE,
echo=
T
}
```{r echo=
F
}
point_projection <- function(diy_cov, x, y){
point_projection <- function(diy_cov, x, y){
a <- c(x, y)
a <- c(x, y)
b <- eigen(diy_cov)$vector[, 1]
b <- eigen(diy_cov)$vector[, 1]
...
@@ -544,7 +544,7 @@ We are now going to plot the second principal component and the projection of th
...
@@ -544,7 +544,7 @@ We are now going to plot the second principal component and the projection of th
Adapt your previous code to perform the computation on the PC2
Adapt your previous code to perform the computation on the PC2
</div>
</div>
```{r
include=FALSE,
echo=
T
}
```{r echo=
F
}
point_projection <- function(diy_cov, x, y){
point_projection <- function(diy_cov, x, y){
a <- c(x, y)
a <- c(x, y)
b <- eigen(diy_cov)$vector[, 2]
b <- eigen(diy_cov)$vector[, 2]
...
@@ -654,7 +654,7 @@ For 3 variables ?
...
@@ -654,7 +654,7 @@ For 3 variables ?
You can merge your previous computation to plot the projection on the 2 first PCs
You can merge your previous computation to plot the projection on the 2 first PCs
</div>
</div>
```{r
include=FALSE,
echo=
T
}
```{r echo=
F
}
point_projection <- function(diy_cov, x, y, PC){
point_projection <- function(diy_cov, x, y, PC){
a <- c(x, y)
a <- c(x, y)
b <- eigen(diy_cov)$vector[, PC]
b <- eigen(diy_cov)$vector[, PC]
...
@@ -894,7 +894,7 @@ pc_var / sum(pc_var)
...
@@ -894,7 +894,7 @@ pc_var / sum(pc_var)
The `fviz_eig` function create a scree plot of your PCA.
The `fviz_eig` function create a scree plot of your PCA.
```{r
include=FALSE,
echo=
T
}
```{r echo=
F
}
fviz_eig(data_f_pca)
fviz_eig(data_f_pca)
```
```
...
@@ -934,7 +934,7 @@ It means that if `bill_depth_mm` contribute for 1 to PC1, `bill_length_mm` contr
...
@@ -934,7 +934,7 @@ It means that if `bill_depth_mm` contribute for 1 to PC1, `bill_length_mm` contr
As the number of variables increases, so is the complexity of the linear combinations for each PC.
As the number of variables increases, so is the complexity of the linear combinations for each PC.
We can represent the variable axis in the new PCA axis, this representation is called the correlation circle.
We can represent the variable axis in the new PCA axis, this representation is called the correlation circle.
```{r,
include=F,
echo=
T
}
```{r, echo=
F
}
fviz_pca_var(data_f_pca, col.var = "contrib")
fviz_pca_var(data_f_pca, col.var = "contrib")
```
```
...
@@ -949,7 +949,7 @@ Use the `str()` function to find this information in the `data_f_pca` object
...
@@ -949,7 +949,7 @@ Use the `str()` function to find this information in the `data_f_pca` object
Finally, we can use the `fviz_pca_biplot` function to display the individuals and variable information on the same plot.
Finally, we can use the `fviz_pca_biplot` function to display the individuals and variable information on the same plot.
```{r,
include=F,
echo=
T
}
```{r, echo=
F
}
fviz_pca_biplot(
fviz_pca_biplot(
data_f_pca, geom = "point",
data_f_pca, geom = "point",
col.ind = (data %>% filter(sex == "female") %>% pull(species)),
col.ind = (data %>% filter(sex == "female") %>% pull(species)),
...
...
This diff is collapsed.
Click to expand it.
Practical_b.Rmd
+
3
−
3
View file @
95129a51
...
@@ -214,7 +214,7 @@ data_pca <- data[var_gene_2000[1:600], ] %>%
...
@@ -214,7 +214,7 @@ data_pca <- data[var_gene_2000[1:600], ] %>%
</p>
</p>
</details>
</details>
```{r,
include=F,
echo=
T
}
```{r, echo=
F
}
data_pca %>%
data_pca %>%
fviz_pca_ind(
fviz_pca_ind(
geom = "point",
geom = "point",
...
@@ -384,7 +384,7 @@ Why is the `centers` parameter required for `kmeans()` and not for the `hclust()
...
@@ -384,7 +384,7 @@ Why is the `centers` parameter required for `kmeans()` and not for the `hclust()
We want to compare the cells annotation to our clustering.
We want to compare the cells annotation to our clustering.
```{r,
include=F,
echo=
T
}
```{r, echo=
F
}
data_pca %>%
data_pca %>%
fviz_pca_ind(
fviz_pca_ind(
geom = "point",
geom = "point",
...
@@ -396,7 +396,7 @@ data_pca %>%
...
@@ -396,7 +396,7 @@ data_pca %>%
Using the `str()` function make the following plot from your k-means results.
Using the `str()` function make the following plot from your k-means results.
</div>
</div>
```{r,
include=F,
echo =
T
}
```{r, echo =
F
}
data_pca %>%
data_pca %>%
fviz_pca_ind(
fviz_pca_ind(
geom = "point",
geom = "point",
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment