Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
pycaret
提交
67d4cd12
pycaret
项目概览
OpenDocCN
/
pycaret
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
pycaret
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
67d4cd12
编写于
7月 20, 2020
作者:
P
PyCaret
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pycaret-nightly==0.33
上级
b1390689
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
15 deletion
+42
-15
pycaret/anomaly.py
pycaret/anomaly.py
+22
-1
pycaret/utils.py
pycaret/utils.py
+19
-13
setup.py
setup.py
+1
-1
未找到文件。
pycaret/anomaly.py
浏览文件 @
67d4cd12
...
...
@@ -3565,12 +3565,33 @@ def get_outliers(data,
else
:
ignore_features_pass
=
ignore_features
global
X
,
data_
,
seed
,
n_jobs_param
,
logging_param
global
X
,
data_
,
seed
,
n_jobs_param
,
logging_param
,
logger
n_jobs_param
=
n_jobs
logging_param
=
False
import
logging
logger
=
logging
.
getLogger
(
'logs'
)
logger
.
setLevel
(
logging
.
DEBUG
)
# create console handler and set level to debug
if
logger
.
hasHandlers
():
logger
.
handlers
.
clear
()
ch
=
logging
.
FileHandler
(
'logs.log'
)
ch
.
setLevel
(
logging
.
DEBUG
)
# create formatter
formatter
=
logging
.
Formatter
(
'%(asctime)s:%(levelname)s:%(message)s'
)
# add formatter to ch
ch
.
setFormatter
(
formatter
)
# add ch to logger
logger
.
addHandler
(
ch
)
data_
=
data
.
copy
()
seed
=
99
...
...
pycaret/utils.py
浏览文件 @
67d4cd12
...
...
@@ -2,7 +2,7 @@
# Author: Moez Ali <moez.ali@queensu.ca>
# License: MIT
version_
=
"pycaret-nightly-0.3
2
"
version_
=
"pycaret-nightly-0.3
3
"
def
version
():
print
(
version_
)
...
...
@@ -21,73 +21,79 @@ def check_metric(actual, prediction, metric, round=4):
#metric calculation starts here
if
metric
==
'
a
ccuracy'
:
if
metric
==
'
A
ccuracy'
:
from
sklearn
import
metrics
result
=
metrics
.
accuracy_score
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'
r
ecall'
:
elif
metric
==
'
R
ecall'
:
from
sklearn
import
metrics
result
=
metrics
.
recall_score
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'
p
recision'
:
elif
metric
==
'
P
recision'
:
from
sklearn
import
metrics
result
=
metrics
.
precision_score
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'
f
1'
:
elif
metric
==
'
F
1'
:
from
sklearn
import
metrics
result
=
metrics
.
f1_score
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'
k
appa'
:
elif
metric
==
'
K
appa'
:
from
sklearn
import
metrics
result
=
metrics
.
cohen_kappa_score
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'
auc
'
:
elif
metric
==
'
AUC
'
:
from
sklearn
import
metrics
result
=
metrics
.
roc_auc_score
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'mae'
:
elif
metric
==
'MCC'
:
from
sklearn
import
metrics
result
=
metrics
.
matthews_corrcoef
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'MAE'
:
from
sklearn
import
metrics
result
=
metrics
.
mean_absolute_error
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'
mse
'
:
elif
metric
==
'
MSE
'
:
from
sklearn
import
metrics
result
=
metrics
.
mean_squared_error
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'
rmse
'
:
elif
metric
==
'
RMSE
'
:
from
sklearn
import
metrics
result
=
metrics
.
mean_squared_error
(
actual
,
prediction
)
result
=
np
.
sqrt
(
result
)
result
=
result
.
round
(
round
)
elif
metric
==
'
r
2'
:
elif
metric
==
'
R
2'
:
from
sklearn
import
metrics
result
=
metrics
.
r2_score
(
actual
,
prediction
)
result
=
result
.
round
(
round
)
elif
metric
==
'
rmsle
'
:
elif
metric
==
'
RMSLE
'
:
result
=
np
.
sqrt
(
np
.
mean
(
np
.
power
(
np
.
log
(
np
.
array
(
abs
(
prediction
))
+
1
)
-
np
.
log
(
np
.
array
(
abs
(
actual
))
+
1
),
2
)))
result
=
result
.
round
(
round
)
elif
metric
==
'
mape
'
:
elif
metric
==
'
MAPE
'
:
mask
=
actual
!=
0
result
=
(
np
.
fabs
(
actual
-
prediction
)
/
actual
)[
mask
].
mean
()
...
...
setup.py
浏览文件 @
67d4cd12
...
...
@@ -13,7 +13,7 @@ with open('requirements.txt') as f:
setup
(
name
=
"pycaret-nightly"
,
version
=
"0.3
2
"
,
version
=
"0.3
3
"
,
description
=
"Nightly build of PyCaret - An open source, low-code machine learning library in Python."
,
long_description
=
readme
(),
long_description_content_type
=
"text/markdown"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录