Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
manuscript_code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
Maria Voigt
manuscript_code
Commits
1d3028ec
Commit
1d3028ec
authored
8 years ago
by
Maria Voigt
Browse files
Options
Downloads
Patches
Plain Diff
fixing typo bug in abundance_prediction
parent
71a28d2a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/prediction/abundance_prediction.R
+2
-4
2 additions, 4 deletions
src/prediction/abundance_prediction.R
with
2 additions
and
4 deletions
src/prediction/abundance_prediction.R
+
2
−
4
View file @
1d3028ec
...
@@ -120,17 +120,15 @@ names(predictor_estimates) <- c("intercept", predictor_names,
...
@@ -120,17 +120,15 @@ names(predictor_estimates) <- c("intercept", predictor_names,
# more correct in terms of being sure that the right thing is done,
# more correct in terms of being sure that the right thing is done,
# but takes a bit longer (52s, to 35s for 100 rows)
# but takes a bit longer (52s, to 35s for 100 rows)
## PLUS PAY ATTENTION, IF PREDICTIONS NOT SAME NROW--> VALUES GET RECYCLED
## PLUS PAY ATTENTION, IF PREDICTIONS NOT SAME NROW--> VALUES GET RECYCLED
print
(
paste
(
"1. start pred_per_cell"
,
Sys.time
()))
print
(
paste
(
"1. start pred_per_cell"
,
Sys.time
()))
pred_per_cell
<-
foreach
(
i
=
1
:
nrow
(
predictor_estimates
),
.combine
=
c
)
%dopar%
{
pred_per_cell
<-
foreach
(
i
=
1
:
nrow
(
predictor_estimates
),
.combine
=
c
)
%dopar%
{
# pred_per_cell <- foreach(i = 1:100, .combine = c) %dopar% {
# pred_per_cell <- foreach(i = 1:100, .combine = c) %dopar% {
t_predictor_estimates
<-
t
(
predictor_estimates
[
i
,
])
t_predictor_estimates
<-
t
(
predictor_estimates
[
i
,
])
pred_estimates_wcoeffs
<-
data.frame
(
mapply
(
`*`
,
coeffs
,
t_predictor_estimates
,
SIMPLIFY
=
F
))
pred_estimates_wcoeffs
<-
data.frame
(
mapply
(
`*`
,
coeffs
,
t_predictor_estimates
,
SIMPLIFY
=
F
))
pred_estimates_sum
<-
apply
(
pred_estimates_wcoeffs
,
1
,
sum
)
pred_estimates_sum
<-
apply
(
pred_estimates_wcoeffs
,
1
,
sum
)
# check this
# sonst zeroinflated part. wahrscheinlichkeit das null ist durhc 1- --> wahrscheinl das es 1 ist
# wahrscheinlich macht es auch sinn da prediktoren drin zu haben in zeroinflated part
pred_estimates_weighted
<-
pred_estimates_sum
*
abundMod_results
$
w_aic
pred_estimates_weighted
<-
pred_estimates_sum
*
abundMod_results
$
w_aic
pred_estimates_calc
<-
sum
(
pred_estimates_weig
t
hed
)
pred_estimates_calc
<-
sum
(
pred_estimates_weigh
t
ed
)
return
(
exp
(
pred_estimates_calc
))
return
(
exp
(
pred_estimates_calc
))
}
}
...
...
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