Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
model-data-test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
model-data-test
Commits
eeb3bfc2
Commit
eeb3bfc2
authored
Feb 09, 2022
by
桂秋月
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1b52af81
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
323 additions
and
40 deletions
+323
-40
workspace.xml
.idea/workspace.xml
+4
-1
2022-02-09.log
logs/2022-02-09.log
+280
-0
Automatic_Handler.py
model_data_api/handler/Automatic_Handler.py
+26
-26
Automatic_Handler.cpython-37.pyc
..._api/handler/__pycache__/Automatic_Handler.cpython-37.pyc
+0
-0
logic.py
model_data_api/handler/logic.py
+1
-1
base_model.cpython-37.pyc
model_data_api/model/__pycache__/base_model.cpython-37.pyc
+0
-0
base_model.py
model_data_api/model/base_model.py
+12
-12
No files found.
.idea/workspace.xml
View file @
eeb3bfc2
...
...
@@ -6,7 +6,10 @@
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"65ec9bc1-9334-4fb0-a73d-621c8e760de6"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/model_data_test/settings.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/model_data_test/settings.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/logs/2022-02-09.log"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/logs/2022-02-09.log"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/model_data_api/handler/Automatic_Handler.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/model_data_api/handler/Automatic_Handler.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/model_data_api/handler/logic.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/model_data_api/handler/logic.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/model_data_api/model/base_model.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/model_data_api/model/base_model.py"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
logs/2022-02-09.log
View file @
eeb3bfc2
This diff is collapsed.
Click to expand it.
model_data_api/handler/Automatic_Handler.py
View file @
eeb3bfc2
...
...
@@ -23,35 +23,35 @@ class AutomaticHandler(BaseHandler):
self
.
auto_feature
=
[]
self
.
auto_dataset
=
{
"data_basic"
:{
"model_name"
:
self
.
model_name
,
"count"
:
self
.
user_count
},
"data_detail"
:[]}
#try :
url
=
'http://rc-model-exec.quantgroups.com/manage/features'
r
=
requests
.
post
(
url
,
data
=
{
'codes'
:
self
.
model_name
})
if
r
.
status_code
==
200
:
response
=
r
.
json
()
self
.
feature_name
=
response
[
'data'
][
self
.
model_name
][
'new'
]
+
response
[
'data'
][
self
.
model_name
][
'old'
]
print
(
'获取模型新旧数据:'
,
self
.
feature_name
)
result
=
self
.
get_auto
()
self
.
write
(
JsonUtil
.
build_json_data
(
code
=
result
[
'code'
],
message
=
result
[
'message'
],
result
=
result
[
'result'
],
json_path
=
result
[
'json_path'
]
try
:
url
=
'http://rc-model-exec.quantgroups.com/manage/features'
r
=
requests
.
post
(
url
,
data
=
{
'codes'
:
self
.
model_name
})
if
r
.
status_code
==
200
:
response
=
r
.
json
()
self
.
feature_name
=
response
[
'data'
][
self
.
model_name
][
'new'
]
+
response
[
'data'
][
self
.
model_name
][
'old'
]
print
(
'获取模型新旧数据:'
,
self
.
feature_name
)
result
=
self
.
get_auto
()
self
.
write
(
JsonUtil
.
build_json_data
(
code
=
result
[
'code'
],
message
=
result
[
'message'
],
result
=
result
[
'result'
],
json_path
=
result
[
'json_path'
]
))
self
.
flush
()
self
.
finish
()
except
:
self
.
write
(
JsonUtil
.
build_json_data
(
code
=
500
,
message
=
"特征列表获取失败"
,
result
=
[],
json_path
=
''
))
self
.
flush
()
self
.
finish
()
else
:
self
.
write
(
JsonUtil
.
build_json_data
(
code
=
JsonUtil
.
Constants
.
Code_Param_Error
,
message
=
JsonUtil
.
Constants
.
Msg_Param_Error
))
self
.
flush
()
self
.
finish
()
# except:
# self.write(JsonUtil.build_json_data(code=500,
# message="特征列表获取失败",
# result = [],
# json_path = ''
# ))
# self.flush()
# self.finish()
# else:
# self.write(JsonUtil.build_json_data(code=JsonUtil.Constants.Code_Param_Error,
# message=JsonUtil.Constants.Msg_Param_Error
# ))
# self.flush()
# self.finish()
def
get_auto
(
self
):
modelsData
=
ModelsDataManager
()
...
...
model_data_api/handler/__pycache__/Automatic_Handler.cpython-37.pyc
View file @
eeb3bfc2
No preview for this file type
model_data_api/handler/logic.py
View file @
eeb3bfc2
...
...
@@ -178,7 +178,7 @@ def add_userTest_logic(session,file_path,common,count,isTrue=True):
if
not
isTrue
:
_df_result
[
'batch_uuid'
]
=
_df_result
[
'batch_uuid'
]
.
apply
(
lambda
x
:
hashlib
.
md5
(
str
(
datetime
.
datetime
.
now
())
.
encode
(
encoding
=
'UTF-8'
))
.
hexdigest
())
else
:
uuid_path
=
get_path
(
common
,
'DATA'
,
'uuid
1
.csv'
)
uuid_path
=
get_path
(
common
,
'DATA'
,
'uuid.csv'
)
temp_uuid
=
pd
.
read_csv
(
uuid_path
,
encoding
=
'utf-8'
)[
'uuid'
]
_df_result
[
'batch_uuid'
]
=
temp_uuid
[:
int
(
count
)]
# print('uuid==',_df_result['batch_uuid'])
...
...
model_data_api/model/__pycache__/base_model.cpython-37.pyc
View file @
eeb3bfc2
No preview for this file type
model_data_api/model/base_model.py
View file @
eeb3bfc2
...
...
@@ -62,18 +62,18 @@ class BaseManager:
def
get_json
(
self
,
result
):
logging
.
info
(
'base result:'
+
str
(
result
)
+
str
(
type
(
result
)))
#
try:
if
isinstance
(
result
,
Iterable
):
tmp
=
[
dict
(
zip
(
res
.
__dict__
.
keys
(),
res
.
__dict__
.
values
()))
for
res
in
result
]
for
t
in
tmp
:
t
.
pop
(
'_sa_instance_state'
)
else
:
tmp
=
dict
(
zip
(
result
.
__dict__
.
keys
(),
result
.
__dict__
.
values
()))
tmp
.
pop
(
'_sa_instance_state'
)
return
tmp
#
except BaseException as e:
#
print(e.args)
#
raise TypeError('Type error of parameter')
try
:
if
isinstance
(
result
,
Iterable
):
tmp
=
[
dict
(
zip
(
res
.
__dict__
.
keys
(),
res
.
__dict__
.
values
()))
for
res
in
result
]
for
t
in
tmp
:
t
.
pop
(
'_sa_instance_state'
)
else
:
tmp
=
dict
(
zip
(
result
.
__dict__
.
keys
(),
result
.
__dict__
.
values
()))
tmp
.
pop
(
'_sa_instance_state'
)
return
tmp
except
BaseException
as
e
:
print
(
e
.
args
)
raise
TypeError
(
'Type error of parameter'
)
# def __default__(self,obj):
# if isinstance(obj, datetime):
...
...
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