Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
Esteban Blanc
proview
Commits
18d714d0
Commit
18d714d0
authored
Nov 28, 2019
by
pwrd
Committed by
Claes Sjöfors
Mar 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sev_analyse server file moved to home directory
parent
2947938a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
sev/exp/py/src/sev_analyse.py
sev/exp/py/src/sev_analyse.py
+13
-13
sev/exp/py/src/sev_eva.py
sev/exp/py/src/sev_eva.py
+3
-3
src/exp/py/src/rt_mva.py
src/exp/py/src/rt_mva.py
+1
-1
No files found.
sev/exp/py/src/sev_analyse.py
View file @
18d714d0
...
@@ -311,18 +311,18 @@ class LinRegModel:
...
@@ -311,18 +311,18 @@ class LinRegModel:
self
.
slr
=
Lasso
(
alpha
=
alpha
,
max_iter
=
maxiter
)
self
.
slr
=
Lasso
(
alpha
=
alpha
,
max_iter
=
maxiter
)
reg
=
self
.
slr
.
fit
(
self
.
wdata
.
wd
.
iloc
[:,
1
:],
self
.
wdata
.
wd
.
iloc
[:,
0
:
1
])
reg
=
self
.
slr
.
fit
(
self
.
wdata
.
wd
.
iloc
[:,
1
:],
self
.
wdata
.
wd
.
iloc
[:,
0
:
1
])
print
"params"
,
self
.
slr
.
get_params
()
#
print "params", self.slr.get_params()
print
"coef "
,
self
.
slr
.
coef_
#
print "coef ", self.slr.coef_
print
"intercept "
,
self
.
slr
.
intercept_
#
print "intercept ", self.slr.intercept_
coeff
=
[
None
]
*
len
(
self
.
wdata
.
wdname
)
coeff
=
[
None
]
*
len
(
self
.
wdata
.
wdname
)
coeff
[
0
]
=
self
.
slr
.
intercept_
[
0
]
coeff
[
0
]
=
self
.
slr
.
intercept_
[
0
]
if
self
.
type
==
self
.
TYPE_LASSO_REGRESSION
:
if
self
.
type
==
self
.
TYPE_LASSO_REGRESSION
:
for
i
in
range
(
1
,
len
(
self
.
wdata
.
wdname
)):
for
i
in
range
(
1
,
len
(
self
.
wdata
.
wdname
)):
print
i
,
self
.
slr
.
coef_
[
i
-
1
]
#
print i, self.slr.coef_[i-1]
coeff
[
i
]
=
self
.
slr
.
coef_
[
i
-
1
]
coeff
[
i
]
=
self
.
slr
.
coef_
[
i
-
1
]
else
:
else
:
for
i
in
range
(
1
,
len
(
self
.
wdata
.
wdname
)):
for
i
in
range
(
1
,
len
(
self
.
wdata
.
wdname
)):
print
i
,
self
.
slr
.
coef_
[
0
][
i
-
1
]
#
print i, self.slr.coef_[0][i-1]
coeff
[
i
]
=
self
.
slr
.
coef_
[
0
][
i
-
1
]
coeff
[
i
]
=
self
.
slr
.
coef_
[
0
][
i
-
1
]
self
.
regrcoef_draw
(
coeff
)
self
.
regrcoef_draw
(
coeff
)
...
@@ -737,7 +737,7 @@ class MLPModel:
...
@@ -737,7 +737,7 @@ class MLPModel:
i
=
0
i
=
0
while
i
<
self
.
mlp
.
n_layers_
-
1
:
while
i
<
self
.
mlp
.
n_layers_
-
1
:
j
=
0
j
=
0
print
'layer_sizes'
,
i
,
len
(
layer_sizes
),
layer_sizes
#
print 'layer_sizes', i, len(layer_sizes), layer_sizes
while
j
<
layer_sizes
[
i
]:
while
j
<
layer_sizes
[
i
]:
fp
.
write
(
str
(
self
.
mlp
.
intercepts_
[
i
][
j
])
+
' '
)
fp
.
write
(
str
(
self
.
mlp
.
intercepts_
[
i
][
j
])
+
' '
)
j
+=
1
j
+=
1
...
@@ -811,7 +811,7 @@ class MLPModel:
...
@@ -811,7 +811,7 @@ class MLPModel:
i
=
0
i
=
0
while
i
<
self
.
mlp
.
n_layers_
-
1
:
while
i
<
self
.
mlp
.
n_layers_
-
1
:
if
i
<
self
.
mlp
.
n_layers_
-
2
:
if
i
<
self
.
mlp
.
n_layers_
-
2
:
print
'i+1'
,
i
+
1
,
len
(
h
)
#
print 'i+1', i+1, len(h)
h
[
i
]
=
[
None
]
*
len
(
self
.
mlp
.
coefs_
[
i
+
1
])
h
[
i
]
=
[
None
]
*
len
(
self
.
mlp
.
coefs_
[
i
+
1
])
else
:
else
:
h
[
i
]
=
[
None
]
*
1
h
[
i
]
=
[
None
]
*
1
...
@@ -862,7 +862,7 @@ class MLPModel:
...
@@ -862,7 +862,7 @@ class MLPModel:
res
=
self
.
mlp
.
predict
(
X
)
res
=
self
.
mlp
.
predict
(
X
)
score
=
r2_score
(
res
,
self
.
wdata
.
wd
[
self
.
wdata
.
wdcol
[
0
]])
score
=
r2_score
(
res
,
self
.
wdata
.
wd
[
self
.
wdata
.
wdcol
[
0
]])
print
'Score'
,
score
#
print 'Score', score
layo
=
1
*
100
+
10
layo
=
1
*
100
+
10
...
@@ -1010,7 +1010,7 @@ class WdWindow:
...
@@ -1010,7 +1010,7 @@ class WdWindow:
i
=
0
i
=
0
for
col
in
self
.
wdata
.
wdcol
:
for
col
in
self
.
wdata
.
wdcol
:
print
col
,
mean
[
i
],
std
[
i
]
#
print col, mean[i], std[i]
l
=
Label
(
dia
,
text
=
col
,
bg
=
bgcolor
)
l
=
Label
(
dia
,
text
=
col
,
bg
=
bgcolor
)
l
.
grid
(
column
=
0
,
row
=
i
+
1
,
padx
=
20
,
pady
=
5
,
sticky
=
W
)
l
.
grid
(
column
=
0
,
row
=
i
+
1
,
padx
=
20
,
pady
=
5
,
sticky
=
W
)
l
=
Label
(
dia
,
text
=
str
(
mean
[
i
]),
bg
=
bgcolor
)
l
=
Label
(
dia
,
text
=
str
(
mean
[
i
]),
bg
=
bgcolor
)
...
@@ -1829,7 +1829,7 @@ class FetchSev:
...
@@ -1829,7 +1829,7 @@ class FetchSev:
# Server entry
# Server entry
# Read last server from file
# Read last server from file
try
:
try
:
fp
=
open
(
pwrp_tmp
+
"/sevserver.dat"
,
"r"
)
fp
=
open
(
home
+
"/sevserver.dat"
,
"r"
)
srv
=
fp
.
read
()
srv
=
fp
.
read
()
fp
.
close
()
fp
.
close
()
except
IOError
:
except
IOError
:
...
@@ -1872,7 +1872,7 @@ class FetchSev:
...
@@ -1872,7 +1872,7 @@ class FetchSev:
# Store server to file
# Store server to file
try
:
try
:
fp
=
open
(
pwrp_tmp
+
"/sevserver.dat"
,
"w"
)
fp
=
open
(
home
+
"/sevserver.dat"
,
"w"
)
fp
.
write
(
self
.
server
)
fp
.
write
(
self
.
server
)
fp
.
close
()
fp
.
close
()
except
IOError
:
except
IOError
:
...
@@ -2023,7 +2023,7 @@ class FetchSev:
...
@@ -2023,7 +2023,7 @@ class FetchSev:
return
return
origdata
=
pd
.
DataFrame
(
data
=
result
)
origdata
=
pd
.
DataFrame
(
data
=
result
)
print
'Frame len'
,
len
(
origdata
),
origdata
.
columns
,
origcol
#
print 'Frame len', len(origdata), origdata.columns, origcol
origdata
.
columns
=
origcol
origdata
.
columns
=
origcol
self
.
wdata
.
new_data
(
origdata
,
wdcol
,
wdname
)
self
.
wdata
.
new_data
(
origdata
,
wdcol
,
wdname
)
...
@@ -2054,7 +2054,7 @@ for opt, arg in opts:
...
@@ -2054,7 +2054,7 @@ for opt, arg in opts:
formula
=
arg
formula
=
arg
pwr_exe
=
os
.
environ
.
get
(
'pwr_exe'
)
pwr_exe
=
os
.
environ
.
get
(
'pwr_exe'
)
pwrp_tmp
=
os
.
environ
.
get
(
'pwrp_tmp
'
)
home
=
os
.
environ
.
get
(
'HOME
'
)
bgcolor
=
'white'
bgcolor
=
'white'
buttoncolor
=
'#F0F0F0'
buttoncolor
=
'#F0F0F0'
...
...
sev/exp/py/src/sev_eva.py
View file @
18d714d0
...
@@ -1784,7 +1784,7 @@ class FetchSev:
...
@@ -1784,7 +1784,7 @@ class FetchSev:
# Server entry
# Server entry
# Read last server from file
# Read last server from file
try
:
try
:
fp
=
open
(
pwrp_tmp
+
"/sevserver.dat"
,
"r"
)
fp
=
open
(
home
+
"/sevserver.dat"
,
"r"
)
srv
=
fp
.
read
()
srv
=
fp
.
read
()
fp
.
close
()
fp
.
close
()
except
IOError
:
except
IOError
:
...
@@ -1821,7 +1821,7 @@ class FetchSev:
...
@@ -1821,7 +1821,7 @@ class FetchSev:
# Store server to file
# Store server to file
try
:
try
:
fp
=
open
(
pwrp_tmp
+
"/sevserver.dat"
,
"w"
)
fp
=
open
(
home
+
"/sevserver.dat"
,
"w"
)
fp
.
write
(
self
.
server
)
fp
.
write
(
self
.
server
)
fp
.
close
()
fp
.
close
()
except
IOError
:
except
IOError
:
...
@@ -2134,7 +2134,7 @@ for opt, arg in opts:
...
@@ -2134,7 +2134,7 @@ for opt, arg in opts:
file
=
arg
file
=
arg
pwr_exe
=
os
.
environ
.
get
(
'pwr_exe'
)
pwr_exe
=
os
.
environ
.
get
(
'pwr_exe'
)
pwrp_tmp
=
os
.
environ
.
get
(
'pwrp_tmp
'
)
home
=
os
.
environ
.
get
(
'HOME
'
)
bgcolor
=
'white'
bgcolor
=
'white'
buttoncolor
=
'#F0F0F0'
buttoncolor
=
'#F0F0F0'
...
...
src/exp/py/src/rt_mva.py
View file @
18d714d0
...
@@ -186,7 +186,7 @@ class WData:
...
@@ -186,7 +186,7 @@ class WData:
self
.
origdata
.
to_csv
(
file
,
index
=
False
)
self
.
origdata
.
to_csv
(
file
,
index
=
False
)
def
save_wd
(
self
,
file
):
def
save_wd
(
self
,
file
):
save
=
self
.
wd
save
=
self
.
wd
.
copy
()
save
.
columns
=
self
.
wdname
save
.
columns
=
self
.
wdname
save
.
insert
(
0
,
'Time'
,
self
.
wdtime
)
save
.
insert
(
0
,
'Time'
,
self
.
wdtime
)
save
.
to_csv
(
file
,
index
=
False
)
save
.
to_csv
(
file
,
index
=
False
)
...
...
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