Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
J
jexio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Godoy, William
jexio
Commits
b6786836
Commit
b6786836
authored
Jul 30, 2020
by
William F Godoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switching X
parent
053a0bf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
src/extractor/AmrexCastro.jl
src/extractor/AmrexCastro.jl
+17
-7
No files found.
src/extractor/AmrexCastro.jl
View file @
b6786836
...
@@ -24,7 +24,7 @@ struct AmrexCastro <: AbstractAmrex
...
@@ -24,7 +24,7 @@ struct AmrexCastro <: AbstractAmrex
"castro.max_grid_size"
,
"castro.max_grid_size"
,
],
],
Dict
{
String
,
Array
{
String
}}(
Dict
{
String
,
Array
{
String
}}(
"plots_size"
=>
[
"amr.nplot_files"
,
"amr.ncells"
,
"amr.max_level"
],
"plots_size"
=>
[
"amr.nplot_files"
,
"amr.ncells"
],
"checks_size"
=>
[
"checks_size"
=>
[
"amr.check_int"
,
"amr.check_int"
,
"amr.ncheck_files"
,
"amr.ncheck_files"
,
...
@@ -128,21 +128,31 @@ function _run_linear_model_plots_size(extractor::AmrexCastro, X::DataFrames.Data
...
@@ -128,21 +128,31 @@ function _run_linear_model_plots_size(extractor::AmrexCastro, X::DataFrames.Data
push!
(
plotsSizesData
,
[
plotsSize
])
push!
(
plotsSizesData
,
[
plotsSize
])
end
end
println
(
plotsSizesData
)
# Prepare the X independent variables in the linear model
# Prepare the X independent variables in the linear model
XNames
::
Array
{
String
}
=
extractor
.
outputs
[
"plots_size"
]
XNames
::
Array
{
String
}
=
extractor
.
outputs
[
"plots_size"
]
for
XName
in
XNames
col1
=
Symbol
(
"amr.nplot_files"
)
columnName
=
Symbol
(
XName
)
col2
=
Symbol
(
"amr.ncells"
)
insert!
(
plotsSizesData
,
2
,
X
[
!
,
col1
]
.*
X
[
!
,
col2
],
:
new_data
)
#plotsSizesData[!,col1] =
#for XName in XNames
#columnName = Symbol(XName)
# this syntax [!, symbol] does not make a copy, use [:, symbol] for copies
# this syntax [!, symbol] does not make a copy, use [:, symbol] for copies
plotsSizesData
[
!
,
columnName
]
=
X
[
!
,
columnName
]
#
plotsSizesData[!, columnName] = X[!, columnName]
end
#
end
# formula from https://discourse.julialang.org/t/glm-jl-with-unknown-column-names/20692/5
# formula from https://discourse.julialang.org/t/glm-jl-with-unknown-column-names/20692/5
response
=
Symbol
(
names
(
plotsSizesData
)[
1
])
response
=
Symbol
(
names
(
plotsSizesData
)[
1
])
predictors
=
Symbol
.
(
names
(
plotsSizesData
)[
2
:
end
])
predictors
=
Symbol
.
(
names
(
plotsSizesData
)[
2
:
end
])
println
(
plotsSizesData
)
println
(
plotsSizesData
)
f
=
@eval
(
GLM
.
@formula
(
$
response
~
(
+
)(
1
,
$
(
predictors
...
))))
f
=
@eval
(
GLM
.
@formula
(
$
response
~
(
+
)(
$
(
predictors
...
))))
ols
=
GLM
.
lm
(
f
,
plotsSizesData
)
ols
=
GLM
.
lm
(
f
,
plotsSizesData
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment