Commit 4791a5e8 authored by linfang.wang's avatar linfang.wang

xgb boost done

parent 37c70174
...@@ -11,8 +11,8 @@ def buildDocument(path,filename): ...@@ -11,8 +11,8 @@ def buildDocument(path,filename):
return Document() return Document()
def saveDocument(document,path,filename): def saveDocument(document,path,filename):
if str.rfind(filename,0,3)!='doc': if filename[-3:] != 'doc':
if str.rfind(filename,0,4) !='docx': if filename[-4:] != 'docx':
raise ValueError('{} is not a word file'.format(filename)) raise ValueError('{} is not a word file'.format(filename))
return document.save(os.path.join(path,filename)) return document.save(os.path.join(path,filename))
......
...@@ -101,7 +101,8 @@ def draw_barplot(df,x,y,hue='',title=''): ...@@ -101,7 +101,8 @@ def draw_barplot(df,x,y,hue='',title=''):
pltz = PyplotZ() pltz = PyplotZ()
pltz.enable_chinese() pltz.enable_chinese()
fig = plt.figure() fig = plt.figure()
ax = fig.add_subplot(1, 1, 1) # ax = fig.add_subplot(1, 1, 1)
plt.cla()
sns.set(style="whitegrid") sns.set(style="whitegrid")
fig = plt.figure(figsize=(6, 4)) fig = plt.figure(figsize=(6, 4))
...@@ -116,7 +117,7 @@ def draw_barplot(df,x,y,hue='',title=''): ...@@ -116,7 +117,7 @@ def draw_barplot(df,x,y,hue='',title=''):
pltz.title(title) pltz.title(title)
pltz.legend() pltz.legend()
plt.grid() plt.grid()
plt.show() # plt.show()
return fig return fig
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment