Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
pycaret
提交
f5a69428
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 搜索 >>
提交
f5a69428
编写于
7月 03, 2020
作者:
P
PyCaret
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update to pycaret-nightly==0.14
上级
362c229d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
70 addition
and
11 deletion
+70
-11
pycaret/classification.py
pycaret/classification.py
+39
-4
pycaret/nlp.py
pycaret/nlp.py
+1
-1
pycaret/regression.py
pycaret/regression.py
+28
-4
pycaret/utils.py
pycaret/utils.py
+1
-1
setup.py
setup.py
+1
-1
未找到文件。
pycaret/classification.py
浏览文件 @
f5a69428
...
...
@@ -1702,6 +1702,7 @@ def setup(data,
mlflow
.
set_experiment
(
exp_name_log
)
run_name_
=
'Session Initialized '
+
str
(
USI
)
with
mlflow
.
start_run
(
run_name
=
run_name_
)
as
run
:
# Get active run to log as tag
...
...
@@ -1776,6 +1777,7 @@ def create_model(estimator = None,
method
=
None
,
fold
=
10
,
round
=
4
,
fit_only
=
False
,
#added in pycaret==2.0.0
verbose
=
True
,
system
=
True
,
#added in pycaret==2.0.0
**
kwargs
):
#added in pycaret==2.0.0
...
...
@@ -1842,6 +1844,11 @@ def create_model(estimator = None,
round: integer, default = 4
Number of decimal places the metrics in the score grid will be rounded to.
fit_only: bool, default = False
When fit_only set to True, no cross validation or metric evaluation is performed.
Trained model object returned when using fit_only is same as the one returned
without fit_only.
verbose: Boolean, default = True
Score grid is not printed when verbose is set to False.
...
...
@@ -1932,13 +1939,20 @@ def create_model(estimator = None,
if
type
(
verbose
)
is
not
bool
:
sys
.
exit
(
'(Type Error): Verbose parameter can only take argument as True or False.'
)
#checking system parameter
if
type
(
system
)
is
not
bool
:
sys
.
exit
(
'(Type Error): System parameter can only take argument as True or False.'
)
#checking fit_only parameter
if
type
(
fit_only
)
is
not
bool
:
sys
.
exit
(
'(Type Error): fit_only parameter can only take argument as True or False.'
)
#checking boosting conflict with estimators
boosting_not_supported
=
[
'lda'
,
'qda'
,
'ridge'
,
'mlp'
,
'gpc'
,
'svm'
,
'knn'
,
'catboost'
]
if
method
==
'Boosting'
and
estimator
in
boosting_not_supported
:
sys
.
exit
(
"(Type Error): Estimator does not provide class_weights or predict_proba function and hence not supported for the Boosting method. Change the estimator or method to 'Bagging'."
)
'''
ERROR HANDLING ENDS HERE
...
...
@@ -2206,7 +2220,11 @@ def create_model(estimator = None,
MONITOR UPDATE STARTS
'''
monitor
.
iloc
[
1
,
1
:]
=
'Initializing CV'
if
fit_only
:
monitor
.
iloc
[
1
,
1
:]
=
'Fitting '
+
str
(
full_name
)
else
:
monitor
.
iloc
[
1
,
1
:]
=
'Initializing CV'
if
verbose
:
if
html_param
:
update_display
(
monitor
,
display_id
=
'monitor'
)
...
...
@@ -2215,6 +2233,23 @@ def create_model(estimator = None,
MONITOR UPDATE ENDS
'''
if
fit_only
:
if
fix_imbalance_param
:
if
fix_imbalance_method_param
is
None
:
from
imblearn.over_sampling
import
SMOTE
resampler
=
SMOTE
(
random_state
=
seed
)
else
:
resampler
=
fix_imbalance_method_param
Xtrain
,
ytrain
=
resampler
.
fit_sample
(
data_X
,
data_y
)
model
.
fit
(
data_X
,
data_y
)
if
verbose
:
clear_output
()
return
model
fold_num
=
1
...
...
@@ -4659,7 +4694,7 @@ def compare_models(blacklist = None,
update_display
(
monitor
,
display_id
=
'monitor'
)
progress
.
value
+=
1
k
=
model_dict
.
get
(
i
)
m
=
create_model
(
estimator
=
k
,
verbose
=
False
,
system
=
False
)
m
=
create_model
(
estimator
=
k
,
verbose
=
False
,
system
=
False
,
fit_only
=
True
)
model_store_final
.
append
(
m
)
model_fit_end
=
time
.
time
()
...
...
@@ -9156,7 +9191,7 @@ def evaluate_model(estimator):
)
d
=
interact
(
plot_model
,
estimator
=
fixed
(
estimator
),
plot
=
a
)
d
=
interact
(
plot_model
,
estimator
=
fixed
(
estimator
),
plot
=
a
,
save
=
fixed
(
False
),
verbose
=
fixed
(
True
),
system
=
fixed
(
True
)
)
def
finalize_model
(
estimator
):
...
...
pycaret/nlp.py
浏览文件 @
f5a69428
...
...
@@ -2980,7 +2980,7 @@ def evaluate_model(model):
b
=
widgets
.
Dropdown
(
options
=
final_list
,
description
=
'Topic #:'
,
disabled
=
False
)
d
=
interact_manual
(
plot_model
,
model
=
fixed
(
model
),
plot
=
a
,
topic_num
=
b
)
d
=
interact_manual
(
plot_model
,
model
=
fixed
(
model
),
plot
=
a
,
topic_num
=
b
,
save
=
fixed
(
False
),
system
=
fixed
(
True
)
)
...
...
pycaret/regression.py
浏览文件 @
f5a69428
...
...
@@ -1731,7 +1731,8 @@ def create_model(estimator = None,
ensemble
=
False
,
method
=
None
,
fold
=
10
,
round
=
4
,
round
=
4
,
fit_only
=
False
,
#added in pycaret==2.0.0
verbose
=
True
,
system
=
True
,
#added in pycaret==2.0.0
**
kwargs
):
#added in pycaret==2.0.0
...
...
@@ -1805,6 +1806,11 @@ def create_model(estimator = None,
round: integer, default = 4
Number of decimal places the metrics in the score grid will be rounded to.
fit_only: bool, default = False
When fit_only set to True, no cross validation or metric evaluation is performed.
Trained model object returned when using fit_only is same as the one returned
without fit_only.
verbose: Boolean, default = True
Score grid is not printed when verbose is set to False.
...
...
@@ -1888,6 +1894,13 @@ def create_model(estimator = None,
if
type
(
verbose
)
is
not
bool
:
sys
.
exit
(
'(Type Error): Verbose parameter can only take argument as True or False.'
)
#checking system parameter
if
type
(
system
)
is
not
bool
:
sys
.
exit
(
'(Type Error): System parameter can only take argument as True or False.'
)
#checking fit_only parameter
if
type
(
fit_only
)
is
not
bool
:
sys
.
exit
(
'(Type Error): fit_only parameter can only take argument as True or False.'
)
'''
...
...
@@ -2187,7 +2200,11 @@ def create_model(estimator = None,
MONITOR UPDATE STARTS
'''
monitor
.
iloc
[
1
,
1
:]
=
'Initializing CV'
if
fit_only
:
monitor
.
iloc
[
1
,
1
:]
=
'Fitting '
+
str
(
full_name
)
else
:
monitor
.
iloc
[
1
,
1
:]
=
'Initializing CV'
if
verbose
:
if
html_param
:
update_display
(
monitor
,
display_id
=
'monitor'
)
...
...
@@ -2196,6 +2213,13 @@ def create_model(estimator = None,
MONITOR UPDATE ENDS
'''
if
fit_only
:
model
.
fit
(
data_X
,
data_y
)
if
verbose
:
clear_output
()
return
model
fold_num
=
1
...
...
@@ -3994,7 +4018,7 @@ def compare_models(blacklist = None,
update_display
(
monitor
,
display_id
=
'monitor'
)
progress
.
value
+=
1
k
=
model_dict
.
get
(
i
)
m
=
create_model
(
estimator
=
k
,
verbose
=
False
,
system
=
False
)
m
=
create_model
(
estimator
=
k
,
verbose
=
False
,
system
=
False
,
fit_only
=
True
)
model_store_final
.
append
(
m
)
if
len
(
model_store_final
)
==
1
:
...
...
@@ -8107,7 +8131,7 @@ def evaluate_model(estimator):
)
d
=
interact
(
plot_model
,
estimator
=
fixed
(
estimator
),
plot
=
a
)
d
=
interact
(
plot_model
,
estimator
=
fixed
(
estimator
),
plot
=
a
,
save
=
fixed
(
False
),
verbose
=
fixed
(
True
),
system
=
fixed
(
True
)
)
def
finalize_model
(
estimator
):
...
...
pycaret/utils.py
浏览文件 @
f5a69428
...
...
@@ -3,7 +3,7 @@
# License: MIT
def
version
():
print
(
"pycaret-nightly-0.1
3
"
)
print
(
"pycaret-nightly-0.1
4
"
)
def
check_metric
(
actual
,
prediction
,
metric
,
round
=
4
):
...
...
setup.py
浏览文件 @
f5a69428
...
...
@@ -13,7 +13,7 @@ with open('requirements.txt') as f:
setup
(
name
=
"pycaret-nightly"
,
version
=
"0.1
3
"
,
version
=
"0.1
4
"
,
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录