Skip to content

Commit c76929d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6090619 commit c76929d

File tree

11 files changed

+104
-111
lines changed

11 files changed

+104
-111
lines changed

app.json

-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
}
66
}
77
}
8-

datasets/baseballdb/README.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ Chadwick Baseball Bureau (http://www.chadwick-bureau.com),
1010
from its Register of baseball personnel.
1111

1212
Player performance data for 1871 through 2014 is based on the
13-
Lahman Baseball Database, version 2015-01-24, which is
13+
Lahman Baseball Database, version 2015-01-24, which is
1414
Copyright (C) 1996-2015 by Sean Lahman.
1515

1616
The tables Parks.csv and HomeGames.csv are based on the game logs
1717
and park code table published by Retrosheet.
1818
This information is available free of charge from and is copyrighted
19-
by Retrosheet. Interested parties may contact Retrosheet at
19+
by Retrosheet. Interested parties may contact Retrosheet at
2020
http://www.retrosheet.org.
21-
22-

datasets/baseballdb/core/AwardsManagers.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,5 @@ showabu99,BBWAA Manager of the Year,2014,AL,,
176176
willima04,BBWAA Manager of the Year,2014,NL,,
177177
banisje01,BBWAA Manager of the Year,2015,AL,,
178178
maddojo99,BBWAA Manager of the Year,2015,NL,,
179-
francte01,BBWAA Manager of the Year,2016,AL,,
179+
francte01,BBWAA Manager of the Year,2016,AL,,
180180
roberda07,BBWAA Manager of the Year,2016,NL,,

datasets/baseballdb/core/readme2014.txt

+64-65
Large diffs are not rendered by default.

datasets/bikes/Readme.txt

+20-20
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Rua Dr. Roberto Frias, 378
1111

1212

1313
=========================================
14-
Background
14+
Background
1515
=========================================
1616

17-
Bike sharing systems are new generation of traditional bike rentals where whole process from membership, rental and return
18-
back has become automatic. Through these systems, user is able to easily rent a bike from a particular position and return
19-
back at another position. Currently, there are about over 500 bike-sharing programs around the world which is composed of
20-
over 500 thousands bicycles. Today, there exists great interest in these systems due to their important role in traffic,
21-
environmental and health issues.
17+
Bike sharing systems are new generation of traditional bike rentals where whole process from membership, rental and return
18+
back has become automatic. Through these systems, user is able to easily rent a bike from a particular position and return
19+
back at another position. Currently, there are about over 500 bike-sharing programs around the world which is composed of
20+
over 500 thousands bicycles. Today, there exists great interest in these systems due to their important role in traffic,
21+
environmental and health issues.
2222

2323
Apart from interesting real world applications of bike sharing systems, the characteristics of data being generated by
2424
these systems make them attractive for the research. Opposed to other transport services such as bus or subway, the duration
@@ -30,21 +30,21 @@ events in the city could be detected via monitoring these data.
3030
Data Set
3131
=========================================
3232
Bike-sharing rental process is highly correlated to the environmental and seasonal settings. For instance, weather conditions,
33-
precipitation, day of week, season, hour of the day, etc. can affect the rental behaviors. The core data set is related to
34-
the two-year historical log corresponding to years 2011 and 2012 from Capital Bikeshare system, Washington D.C., USA which is
35-
publicly available in http://capitalbikeshare.com/system-data. We aggregated the data on two hourly and daily basis and then
36-
extracted and added the corresponding weather and seasonal information. Weather information are extracted from http://www.freemeteo.com.
33+
precipitation, day of week, season, hour of the day, etc. can affect the rental behaviors. The core data set is related to
34+
the two-year historical log corresponding to years 2011 and 2012 from Capital Bikeshare system, Washington D.C., USA which is
35+
publicly available in http://capitalbikeshare.com/system-data. We aggregated the data on two hourly and daily basis and then
36+
extracted and added the corresponding weather and seasonal information. Weather information are extracted from http://www.freemeteo.com.
3737

3838
=========================================
3939
Associated tasks
4040
=========================================
4141

42-
- Regression:
42+
- Regression:
4343
Predication of bike rental count hourly or daily based on the environmental and seasonal settings.
44-
45-
- Event and Anomaly Detection:
44+
45+
- Event and Anomaly Detection:
4646
Count of rented bikes are also correlated to some events in the town which easily are traceable via search engines.
47-
For instance, query like "2012-10-30 washington d.c." in Google returns related results to Hurricane Sandy. Some of the important events are
47+
For instance, query like "2012-10-30 washington d.c." in Google returns related results to Hurricane Sandy. Some of the important events are
4848
identified in [1]. Therefore the data can be used for validation of anomaly or event detection algorithms as well.
4949

5050

@@ -56,12 +56,12 @@ Files
5656
- hour.csv : bike sharing counts aggregated on hourly basis. Records: 17379 hours
5757
- day.csv - bike sharing counts aggregated on daily basis. Records: 731 days
5858

59-
59+
6060
=========================================
6161
Dataset characteristics
62-
=========================================
62+
=========================================
6363
Both hour.csv and day.csv have the following fields, except hr which is not available in day.csv
64-
64+
6565
- instant: record index
6666
- dteday : date
6767
- season : season (1:springer, 2:summer, 3:fall, 4:winter)
@@ -71,7 +71,7 @@ Both hour.csv and day.csv have the following fields, except hr which is not avai
7171
- holiday : weather day is holiday or not (extracted from http://dchr.dc.gov/page/holiday-schedule)
7272
- weekday : day of the week
7373
- workingday : if day is neither weekend nor holiday is 1, otherwise is 0.
74-
+ weathersit :
74+
+ weathersit :
7575
- 1: Clear, Few clouds, Partly cloudy, Partly cloudy
7676
- 2: Mist + Cloudy, Mist + Broken clouds, Mist + Few clouds, Mist
7777
- 3: Light Snow, Light Rain + Thunderstorm + Scattered clouds, Light Rain + Scattered clouds
@@ -83,7 +83,7 @@ Both hour.csv and day.csv have the following fields, except hr which is not avai
8383
- casual: count of casual users
8484
- registered: count of registered users
8585
- cnt: count of total rental bikes including both casual and registered
86-
86+
8787
=========================================
8888
License
8989
=========================================
@@ -107,5 +107,5 @@ Use of this dataset in publications must be cited to the following publication:
107107
=========================================
108108
Contact
109109
=========================================
110-
110+
111111
For further information about this dataset please contact Hadi Fanaee-T ([email protected])

datasets/biofilm.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ experiment,isolate,ST,OD600,measurement,replicate,normalized_measurement
9494
2,13,4,0.522,1.316,3,2.521072797
9595
2,14,4,0.576,1.959,3,3.401041667
9696
2,15,4,0.427,1.073,3,2.512880562
97-
2,ATCC_29212,30,0.688,1.122,3,1.630813953
97+
2,ATCC_29212,30,0.688,1.122,3,1.630813953

datasets/mlb_2013-2016.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ Season,Team,Team Salary,Team Salary (in millions),League,Wins,Losses,Winning %,A
118118
2013,Tampa Bay Rays,57030272,57,AL,92,71,0.564,5538,700,1421,296,23,165,670,589,1171,73,38,0.257,0.329,0.408,0.737,3.74,42,60,1464,1315,646,608,153,482,1310,0.24,1.23,13176,6044,4392,1593,59,147,0.783,69,0.99,0.708
119119
2013,Texas Rangers,127197575,127.2,AL,91,72,0.558,5585,730,1465,262,23,176,691,462,1067,149,46,0.262,0.323,0.412,0.735,3.62,46,57,1463.1,1370,636,589,157,498,1309,0.248,1.28,13170,6025,4390,1549,86,146,0.682,68,0.986,0.695
120120
2013,Toronto Blue Jays,118244039,118.2,AL,74,88,0.457,5537,712,1398,273,24,185,669,510,1123,112,41,0.252,0.318,0.411,0.729,4.25,39,58,1452,1451,756,685,195,500,1208,0.259,1.34,13068,6072,4356,1605,111,145,0.75,54,0.982,0.691
121-
2013,Washington Nationals,112431770,112.4,NL,86,76,0.531,5436,656,1365,259,27,161,621,464,1192,88,28,0.251,0.313,0.398,0.71,3.59,47,68,1445.2,1367,626,576,142,405,1236,0.249,1.23,13011,5993,4337,1549,107,146,0.826,43,0.982,0.691
121+
2013,Washington Nationals,112431770,112.4,NL,86,76,0.531,5436,656,1365,259,27,161,621,464,1192,88,28,0.251,0.313,0.398,0.71,3.59,47,68,1445.2,1367,626,576,142,405,1236,0.249,1.23,13011,5993,4337,1549,107,146,0.826,43,0.982,0.691

datasets/ship-damage.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ type,yr_construction,period_op,months,n_damages
3232
5,2,2,437,7
3333
5,3,1,1157,5
3434
5,3,2,2161,12
35-
5,4,2,542,1
35+
5,4,2,542,1

models/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ def plot_elbo(self):
115115
plt.plot(-self.advi_hist)
116116
plt.ylabel('ELBO')
117117
plt.xlabel('iteration')
118-
sns.despine()
118+
sns.despine()

models/feedforward.py

+13-15
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@
66

77

88
class ForestCoverModel(BayesianModel):
9-
9+
1010
def __init__(self, n_hidden):
1111
super(ForestCoverModel, self).__init__()
1212
self.n_hidden = n_hidden
1313

1414
def create_model(self, X=None, y=None):
1515
if X:
1616
num_samples, self.num_pred = X.shape
17-
17+
1818
if y:
1919
num_samples, self.num_out = Y.shape
2020

2121
model_input = theano.shared(np.zeros(shape=(1, self.num_pred)))
2222
model_output = theano.shared(np.zeros(shape=(1,self.num_out)))
23-
23+
2424
self.shared_vars = {
2525
'model_input': model_input,
2626
'model_output': model_output
2727
}
28-
28+
2929
with pm.Model() as model:
3030
# Define weights
31-
weights_1 = pm.Normal('w_1', mu=0, sd=1,
31+
weights_1 = pm.Normal('w_1', mu=0, sd=1,
3232
shape=(self.num_pred, self.n_hidden))
3333
weights_2 = pm.Normal('w_2', mu=0, sd=1,
3434
shape=(self.n_hidden, self.n_hidden))
35-
weights_out = pm.Normal('w_out', mu=0, sd=1,
35+
weights_out = pm.Normal('w_out', mu=0, sd=1,
3636
shape=(self.n_hidden, self.num_outs))
3737

3838
# Define activations
@@ -41,29 +41,27 @@ def create_model(self, X=None, y=None):
4141
acts_out = tt.nnet.softmax(tt.dot(acts_2, weights_out)) # noqa
4242

4343
# Define likelihood
44-
out = pm.Multinomial('likelihood', n=1, p=acts_out,
44+
out = pm.Multinomial('likelihood', n=1, p=acts_out,
4545
observed=model_output)
46-
46+
4747
return model
48-
49-
48+
49+
5050
def fit(self, X, y, n=200000, batch_size=10):
5151
"""
5252
Train the Bayesian NN model.
5353
"""
5454
num_samples, self.num_pred = X.shape
5555
_, self.num_out = y.shape
56-
56+
5757
if self.cached_model is None:
5858
self.cached_model = self.create_model()
59-
59+
6060
with self.cached_model:
6161
minibatches = {
6262
self.shared_vars['model_input']: pm.Minibatch(X, batch_size=batch_size),
6363
self.shared_vars['model_output']: pm.Minibatch(y, batch_size=batch_size),
6464
}
6565
self._inference(minibatches, n)
66-
66+
6767
return self
68-
69-

test_gpu.py

-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@
2121
print('Used the cpu')
2222
else:
2323
print('Used the gpu')
24-

0 commit comments

Comments
 (0)