Skip to content

Commit 9e9da69

Browse files
committed
autopep
1 parent 55466ff commit 9e9da69

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

ch05/chose_instances.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@
2323
will not be used in the chapter. If, however, you want to experiment with them
2424
(highly encouraged!), you can get the library from http://packages.python.org/pyenchant/.
2525
""")
26+
2627
class EnchantMock:
28+
2729
def __init__(self):
2830
pass
31+
2932
def check(self, word):
3033
return True
3134
speller = EnchantMock()
@@ -35,7 +38,6 @@ def check(self, word):
3538
filtered_meta = json.load(open(filtered_meta, "r"))
3639

3740

38-
3941
def misspelled_fraction(p):
4042
tokens = p.split()
4143
if not tokens:

ch05/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import os
99

10-
DATA_DIR = "data" # put your posts-2011-12.xml into this directory
10+
DATA_DIR = "data" # put your posts-2011-12.xml into this directory
1111
CHART_DIR = "charts"
1212

1313
filtered = os.path.join(DATA_DIR, "filtered.tsv")

ch05/log_reg_example.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def lr_model(clf, X):
3838
pyplot.xlabel("feature value")
3939
pyplot.ylabel("class")
4040
pyplot.grid(True, linestyle='-', color='0.75')
41-
pyplot.savefig(os.path.join(CHART_DIR, "log_reg_example_data.png"), bbox_inches="tight")
41+
pyplot.savefig(
42+
os.path.join(CHART_DIR, "log_reg_example_data.png"), bbox_inches="tight")
4243

4344

4445
def lin_model(clf, X):
@@ -69,7 +70,8 @@ def lin_model(clf, X):
6970
pyplot.ylabel("class")
7071
pyplot.title("linear fit on additional data")
7172
pyplot.grid(True, linestyle='-', color='0.75')
72-
pyplot.savefig(os.path.join(CHART_DIR, "log_reg_log_linear_fit.png"), bbox_inches="tight")
73+
pyplot.savefig(
74+
os.path.join(CHART_DIR, "log_reg_log_linear_fit.png"), bbox_inches="tight")
7375

7476
pyplot.figure(figsize=(10, 4))
7577
pyplot.xlim((-5, 20))
@@ -79,7 +81,8 @@ def lin_model(clf, X):
7981
pyplot.xlabel("feature value")
8082
pyplot.ylabel("class")
8183
pyplot.grid(True, linestyle='-', color='0.75')
82-
pyplot.savefig(os.path.join(CHART_DIR, "log_reg_example_fitted.png"), bbox_inches="tight")
84+
pyplot.savefig(
85+
os.path.join(CHART_DIR, "log_reg_example_fitted.png"), bbox_inches="tight")
8386

8487
X = np.arange(0, 1, 0.001)
8588
pyplot.figure(figsize=(10, 4))
@@ -97,4 +100,5 @@ def lin_model(clf, X):
97100
pyplot.xlabel("P")
98101
pyplot.ylabel("log(odds) = log(P / (1-P))")
99102
pyplot.grid(True, linestyle='-', color='0.75')
100-
pyplot.savefig(os.path.join(CHART_DIR, "log_reg_log_odds.png"), bbox_inches="tight")
103+
pyplot.savefig(
104+
os.path.join(CHART_DIR, "log_reg_log_odds.png"), bbox_inches="tight")

0 commit comments

Comments
 (0)