Linear Regression Using TF Linear Regressor Estimator API

In [1]:
# Import Dependencies
import numpy as np
import pandas as pd
from sklearn.datasets import load_boston
import tensorflow as tf
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
# Load Data
# Load Dataset
boston = load_boston()
In [3]:
# Seperate Data into Features and Labels and load them as a Pandas Dataframe
# Features
features_df = pd.DataFrame(np.array(boston.data), columns=[boston.feature_names])

features_df.head()
Out[3]:
CRIM ZN INDUS CHAS NOX RM AGE DIS RAD TAX PTRATIO B LSTAT
0 0.00632 18.0 2.31 0.0 0.538 6.575 65.2 4.0900 1.0 296.0 15.3 396.90 4.98
1 0.02731 0.0 7.07 0.0 0.469 6.421 78.9 4.9671 2.0 242.0 17.8 396.90 9.14
2 0.02729 0.0 7.07 0.0 0.469 7.185 61.1 4.9671 2.0 242.0 17.8 392.83 4.03
3 0.03237 0.0 2.18 0.0 0.458 6.998 45.8 6.0622 3.0 222.0 18.7 394.63 2.94
4 0.06905 0.0 2.18 0.0 0.458 7.147 54.2 6.0622 3.0 222.0 18.7 396.90 5.33
In [4]:
# Labels
labels_df = pd.DataFrame(np.array(boston.target), columns=['labels'])
labels_df.head()
Out[4]:
labels
0 24.0
1 21.6
2 34.7
3 33.4
4 36.2
In [5]:
# Combined Data
combined_data = pd.concat([features_df,labels_df], axis=1)
combined_data.head()
Out[5]:
CRIM ZN INDUS CHAS NOX RM AGE DIS RAD TAX PTRATIO B LSTAT labels
0 0.00632 18.0 2.31 0.0 0.538 6.575 65.2 4.0900 1.0 296.0 15.3 396.90 4.98 24.0
1 0.02731 0.0 7.07 0.0 0.469 6.421 78.9 4.9671 2.0 242.0 17.8 396.90 9.14 21.6
2 0.02729 0.0 7.07 0.0 0.469 7.185 61.1 4.9671 2.0 242.0 17.8 392.83 4.03 34.7
3 0.03237 0.0 2.18 0.0 0.458 6.998 45.8 6.0622 3.0 222.0 18.7 394.63 2.94 33.4
4 0.06905 0.0 2.18 0.0 0.458 7.147 54.2 6.0622 3.0 222.0 18.7 396.90 5.33 36.2
In [6]:
# Train Test Split
from sklearn.model_selection import train_test_split
In [7]:
# Train Test Split
# Training Data = 80% of Dataset
# Test Data = 20% of Dataset
X_train, X_test, y_train, y_test = train_test_split(features_df, labels_df, test_size=0.2, random_state=101)
In [8]:
# Normalize Data
from sklearn.preprocessing import StandardScaler
In [9]:
# Define the Preprocessing Method and Fit Training Data to it
scaler = StandardScaler()
scaler.fit(X_train)
Out[9]:
StandardScaler(copy=True, with_mean=True, with_std=True)
In [10]:
# Make X_train to be the Scaled Version of Data
# This process scales all the values in all 6 columns and replaces them with the new values
X_train = pd.DataFrame(data=scaler.transform(X_train), columns=X_train.columns, index=X_train.index)
In [11]:
# Converting from Pandas Dataframe to Numpy Arrays
X_train = np.array(X_train)
y_train = np.array(y_train)
In [12]:
# Get the Type of Training Data
type(X_train), type(y_train)
Out[12]:
(numpy.ndarray, numpy.ndarray)
In [13]:
# Apply same Normalization for Test Features
scal = StandardScaler()
scal.fit(X_test)
Out[13]:
StandardScaler(copy=True, with_mean=True, with_std=True)
In [14]:
# Make X_test to be the Scaled Version of Data
# This process scales all the values in all columns and replaces them with the new values
X_test = pd.DataFrame(data=scal.transform(X_test), columns=X_test.columns, index=X_test.index)
In [15]:
# Convert test features and Labels to Numpy Arrays
X_test = np.array(X_test)
y_test = np.array(y_test)
In [16]:
# Get the Type of Test Data
type(X_test), type(y_test)
Out[16]:
(numpy.ndarray, numpy.ndarray)

Till now all the code has been the same i.e. load the dataset, train test split, preprocessing etc. From here we start defining the Tensorflow code to train the model on this dataset and get some inference from it.

Define TF Linear Regressor Model

In [17]:
# Define Feature Columns for the Linear Regressor
features_df.columns
Out[17]:
Index(['CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE', 'DIS', 'RAD', 'TAX',
       'PTRATIO', 'B', 'LSTAT'],
      dtype='object')
In [18]:
# Make Feature Columns
feat_cols = [tf.feature_column.numeric_column('x', shape=np.array(X_train).shape[1:])]
In [19]:
# Make Input Function
input_func = tf.estimator.inputs.numpy_input_fn({'x':X_train}, y_train, batch_size=1, num_epochs=2000, shuffle=True)
In [20]:
# Define Linear Regressor Model
# Supported Optimizers: ('Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD')
linear_model = tf.estimator.LinearRegressor(feature_columns=feat_cols, optimizer='Adam')
INFO:tensorflow:Using default config.
WARNING:tensorflow:Using temporary folder as model directory: C:\Users\AD1026~1\AppData\Local\Temp\tmprfsb8150
INFO:tensorflow:Using config: {'_master': '', '_task_type': 'worker', '_log_step_count_steps': 100, '_num_worker_replicas': 1, '_session_config': None, '_is_chief': True, '_service': None, '_model_dir': 'C:\\Users\\AD1026~1\\AppData\\Local\\Temp\\tmprfsb8150', '_keep_checkpoint_max': 5, '_save_checkpoints_steps': None, '_task_id': 0, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x00000244F2960AC8>, '_tf_random_seed': None, '_save_checkpoints_secs': 600, '_num_ps_replicas': 0, '_keep_checkpoint_every_n_hours': 10000, '_save_summary_steps': 100}
In [21]:
# Set up Estimator Training Inputs
train_input_func = tf.estimator.inputs.numpy_input_fn(X_train, y_train, batch_size=1, num_epochs=1000, shuffle=False)
In [22]:
# Set up Estimator Test Inputs
eval_input_func = tf.estimator.inputs.numpy_input_fn({'x': X_test}, y_test, batch_size=1, num_epochs=1, shuffle=False)
In [23]:
# Train the Linear Regressor Estimator
linear_model.train(input_fn=input_func, steps=2000)
INFO:tensorflow:Create CheckpointSaverHook.
INFO:tensorflow:Saving checkpoints for 1 into C:\Users\AD1026~1\AppData\Local\Temp\tmprfsb8150\model.ckpt.
INFO:tensorflow:step = 1, loss = 696.96
INFO:tensorflow:global_step/sec: 413.494
INFO:tensorflow:step = 101, loss = 74.3828 (0.243 sec)
INFO:tensorflow:global_step/sec: 530.709
INFO:tensorflow:step = 201, loss = 10.3289 (0.189 sec)
INFO:tensorflow:global_step/sec: 489.263
INFO:tensorflow:step = 301, loss = 1.03166 (0.208 sec)
INFO:tensorflow:global_step/sec: 460.898
INFO:tensorflow:step = 401, loss = 8.2157 (0.213 sec)
INFO:tensorflow:global_step/sec: 550.765
INFO:tensorflow:step = 501, loss = 0.199692 (0.182 sec)
INFO:tensorflow:global_step/sec: 450.264
INFO:tensorflow:step = 601, loss = 2.05755 (0.222 sec)
INFO:tensorflow:global_step/sec: 459.357
INFO:tensorflow:step = 701, loss = 3.06649 (0.219 sec)
INFO:tensorflow:global_step/sec: 436.446
INFO:tensorflow:step = 801, loss = 21.3661 (0.230 sec)
INFO:tensorflow:global_step/sec: 582.77
INFO:tensorflow:step = 901, loss = 3.01006 (0.170 sec)
INFO:tensorflow:global_step/sec: 585.735
INFO:tensorflow:step = 1001, loss = 9.98767 (0.172 sec)
INFO:tensorflow:global_step/sec: 609.552
INFO:tensorflow:step = 1101, loss = 1.37906 (0.165 sec)
INFO:tensorflow:global_step/sec: 548.254
INFO:tensorflow:step = 1201, loss = 616.294 (0.182 sec)
INFO:tensorflow:global_step/sec: 592.502
INFO:tensorflow:step = 1301, loss = 1.45909 (0.167 sec)
INFO:tensorflow:global_step/sec: 526.847
INFO:tensorflow:step = 1401, loss = 12.3732 (0.190 sec)
INFO:tensorflow:global_step/sec: 532.105
INFO:tensorflow:step = 1501, loss = 19.1467 (0.187 sec)
INFO:tensorflow:global_step/sec: 561.445
INFO:tensorflow:step = 1601, loss = 25.8942 (0.179 sec)
INFO:tensorflow:global_step/sec: 558.107
INFO:tensorflow:step = 1701, loss = 11.7785 (0.178 sec)
INFO:tensorflow:global_step/sec: 574.828
INFO:tensorflow:step = 1801, loss = 20.5672 (0.174 sec)
INFO:tensorflow:global_step/sec: 581.733
INFO:tensorflow:step = 1901, loss = 4.65015 (0.172 sec)
INFO:tensorflow:Saving checkpoints for 2000 into C:\Users\AD1026~1\AppData\Local\Temp\tmprfsb8150\model.ckpt.
INFO:tensorflow:Loss for final step: 43.2421.
Out[23]:
<tensorflow.python.estimator.canned.linear.LinearRegressor at 0x244f29605c0>
In [24]:
# Test the Model
test_metrics = linear_model.evaluate(input_fn=eval_input_func, steps=100)
INFO:tensorflow:Starting evaluation at 2018-01-30-17:51:28
INFO:tensorflow:Restoring parameters from C:\Users\AD1026~1\AppData\Local\Temp\tmprfsb8150\model.ckpt-2000
INFO:tensorflow:Evaluation [1/100]
INFO:tensorflow:Evaluation [2/100]
INFO:tensorflow:Evaluation [3/100]
INFO:tensorflow:Evaluation [4/100]
INFO:tensorflow:Evaluation [5/100]
INFO:tensorflow:Evaluation [6/100]
INFO:tensorflow:Evaluation [7/100]
INFO:tensorflow:Evaluation [8/100]
INFO:tensorflow:Evaluation [9/100]
INFO:tensorflow:Evaluation [10/100]
INFO:tensorflow:Evaluation [11/100]
INFO:tensorflow:Evaluation [12/100]
INFO:tensorflow:Evaluation [13/100]
INFO:tensorflow:Evaluation [14/100]
INFO:tensorflow:Evaluation [15/100]
INFO:tensorflow:Evaluation [16/100]
INFO:tensorflow:Evaluation [17/100]
INFO:tensorflow:Evaluation [18/100]
INFO:tensorflow:Evaluation [19/100]
INFO:tensorflow:Evaluation [20/100]
INFO:tensorflow:Evaluation [21/100]
INFO:tensorflow:Evaluation [22/100]
INFO:tensorflow:Evaluation [23/100]
INFO:tensorflow:Evaluation [24/100]
INFO:tensorflow:Evaluation [25/100]
INFO:tensorflow:Evaluation [26/100]
INFO:tensorflow:Evaluation [27/100]
INFO:tensorflow:Evaluation [28/100]
INFO:tensorflow:Evaluation [29/100]
INFO:tensorflow:Evaluation [30/100]
INFO:tensorflow:Evaluation [31/100]
INFO:tensorflow:Evaluation [32/100]
INFO:tensorflow:Evaluation [33/100]
INFO:tensorflow:Evaluation [34/100]
INFO:tensorflow:Evaluation [35/100]
INFO:tensorflow:Evaluation [36/100]
INFO:tensorflow:Evaluation [37/100]
INFO:tensorflow:Evaluation [38/100]
INFO:tensorflow:Evaluation [39/100]
INFO:tensorflow:Evaluation [40/100]
INFO:tensorflow:Evaluation [41/100]
INFO:tensorflow:Evaluation [42/100]
INFO:tensorflow:Evaluation [43/100]
INFO:tensorflow:Evaluation [44/100]
INFO:tensorflow:Evaluation [45/100]
INFO:tensorflow:Evaluation [46/100]
INFO:tensorflow:Evaluation [47/100]
INFO:tensorflow:Evaluation [48/100]
INFO:tensorflow:Evaluation [49/100]
INFO:tensorflow:Evaluation [50/100]
INFO:tensorflow:Evaluation [51/100]
INFO:tensorflow:Evaluation [52/100]
INFO:tensorflow:Evaluation [53/100]
INFO:tensorflow:Evaluation [54/100]
INFO:tensorflow:Evaluation [55/100]
INFO:tensorflow:Evaluation [56/100]
INFO:tensorflow:Evaluation [57/100]
INFO:tensorflow:Evaluation [58/100]
INFO:tensorflow:Evaluation [59/100]
INFO:tensorflow:Evaluation [60/100]
INFO:tensorflow:Evaluation [61/100]
INFO:tensorflow:Evaluation [62/100]
INFO:tensorflow:Evaluation [63/100]
INFO:tensorflow:Evaluation [64/100]
INFO:tensorflow:Evaluation [65/100]
INFO:tensorflow:Evaluation [66/100]
INFO:tensorflow:Evaluation [67/100]
INFO:tensorflow:Evaluation [68/100]
INFO:tensorflow:Evaluation [69/100]
INFO:tensorflow:Evaluation [70/100]
INFO:tensorflow:Evaluation [71/100]
INFO:tensorflow:Evaluation [72/100]
INFO:tensorflow:Evaluation [73/100]
INFO:tensorflow:Evaluation [74/100]
INFO:tensorflow:Evaluation [75/100]
INFO:tensorflow:Evaluation [76/100]
INFO:tensorflow:Evaluation [77/100]
INFO:tensorflow:Evaluation [78/100]
INFO:tensorflow:Evaluation [79/100]
INFO:tensorflow:Evaluation [80/100]
INFO:tensorflow:Evaluation [81/100]
INFO:tensorflow:Evaluation [82/100]
INFO:tensorflow:Evaluation [83/100]
INFO:tensorflow:Evaluation [84/100]
INFO:tensorflow:Evaluation [85/100]
INFO:tensorflow:Evaluation [86/100]
INFO:tensorflow:Evaluation [87/100]
INFO:tensorflow:Evaluation [88/100]
INFO:tensorflow:Evaluation [89/100]
INFO:tensorflow:Evaluation [90/100]
INFO:tensorflow:Evaluation [91/100]
INFO:tensorflow:Evaluation [92/100]
INFO:tensorflow:Evaluation [93/100]
INFO:tensorflow:Evaluation [94/100]
INFO:tensorflow:Evaluation [95/100]
INFO:tensorflow:Evaluation [96/100]
INFO:tensorflow:Evaluation [97/100]
INFO:tensorflow:Evaluation [98/100]
INFO:tensorflow:Evaluation [99/100]
INFO:tensorflow:Evaluation [100/100]
INFO:tensorflow:Finished evaluation at 2018-01-30-17:51:29
INFO:tensorflow:Saving dict for global step 2000: average_loss = 40.0865, global_step = 2000, loss = 40.0865
In [25]:
# Predicted Values
list(linear_model.predict(input_fn=eval_input_func))
INFO:tensorflow:Restoring parameters from C:\Users\AD1026~1\AppData\Local\Temp\tmprfsb8150\model.ckpt-2000
Out[25]:
[{'predictions': array([ 37.04899216], dtype=float32)},
 {'predictions': array([ 26.38247681], dtype=float32)},
 {'predictions': array([ 13.78154087], dtype=float32)},
 {'predictions': array([ 13.09169865], dtype=float32)},
 {'predictions': array([ 31.60310364], dtype=float32)},
 {'predictions': array([ 32.12142181], dtype=float32)},
 {'predictions': array([ 33.36090851], dtype=float32)},
 {'predictions': array([ 11.7517662], dtype=float32)},
 {'predictions': array([ 30.0511837], dtype=float32)},
 {'predictions': array([ 10.83946228], dtype=float32)},
 {'predictions': array([ 29.89947319], dtype=float32)},
 {'predictions': array([ 14.20927906], dtype=float32)},
 {'predictions': array([ 20.44610214], dtype=float32)},
 {'predictions': array([ 15.21302795], dtype=float32)},
 {'predictions': array([ 25.54910088], dtype=float32)},
 {'predictions': array([ 18.84660339], dtype=float32)},
 {'predictions': array([ 9.6119709], dtype=float32)},
 {'predictions': array([ 32.46287918], dtype=float32)},
 {'predictions': array([ 30.16629219], dtype=float32)},
 {'predictions': array([ 25.03372192], dtype=float32)},
 {'predictions': array([ 11.44951248], dtype=float32)},
 {'predictions': array([ 21.86482239], dtype=float32)},
 {'predictions': array([ 24.62771416], dtype=float32)},
 {'predictions': array([ 20.55546188], dtype=float32)},
 {'predictions': array([ 32.608181], dtype=float32)},
 {'predictions': array([ 14.41128349], dtype=float32)},
 {'predictions': array([ 35.99029541], dtype=float32)},
 {'predictions': array([ 17.35890198], dtype=float32)},
 {'predictions': array([ 28.69205093], dtype=float32)},
 {'predictions': array([ 31.28341103], dtype=float32)},
 {'predictions': array([ 18.55209923], dtype=float32)},
 {'predictions': array([ 21.08512878], dtype=float32)},
 {'predictions': array([ 34.10903168], dtype=float32)},
 {'predictions': array([ 46.23236084], dtype=float32)},
 {'predictions': array([ 31.59113693], dtype=float32)},
 {'predictions': array([ 24.6950264], dtype=float32)},
 {'predictions': array([ 11.75291157], dtype=float32)},
 {'predictions': array([ 19.30218315], dtype=float32)},
 {'predictions': array([ 4.54955482], dtype=float32)},
 {'predictions': array([ 32.83533859], dtype=float32)},
 {'predictions': array([ 25.94518661], dtype=float32)},
 {'predictions': array([ 15.33049965], dtype=float32)},
 {'predictions': array([ 33.18548965], dtype=float32)},
 {'predictions': array([ 13.01087952], dtype=float32)},
 {'predictions': array([ 14.65274811], dtype=float32)},
 {'predictions': array([ 24.9969635], dtype=float32)},
 {'predictions': array([ 30.81731224], dtype=float32)},
 {'predictions': array([ 15.91858768], dtype=float32)},
 {'predictions': array([ 26.19374657], dtype=float32)},
 {'predictions': array([ 19.94781303], dtype=float32)},
 {'predictions': array([ 29.539711], dtype=float32)},
 {'predictions': array([ 30.56033707], dtype=float32)},
 {'predictions': array([ 22.70759583], dtype=float32)},
 {'predictions': array([ 19.79312706], dtype=float32)},
 {'predictions': array([ 28.57951927], dtype=float32)},
 {'predictions': array([ 5.47840691], dtype=float32)},
 {'predictions': array([ 22.15537834], dtype=float32)},
 {'predictions': array([ 19.82237244], dtype=float32)},
 {'predictions': array([ 30.01177597], dtype=float32)},
 {'predictions': array([ 22.37309074], dtype=float32)},
 {'predictions': array([ 27.37680817], dtype=float32)},
 {'predictions': array([ 7.53720951], dtype=float32)},
 {'predictions': array([ 17.90460014], dtype=float32)},
 {'predictions': array([ 19.90116882], dtype=float32)},
 {'predictions': array([ 9.71079445], dtype=float32)},
 {'predictions': array([ 24.09114265], dtype=float32)},
 {'predictions': array([ 25.39837646], dtype=float32)},
 {'predictions': array([ 21.74806213], dtype=float32)},
 {'predictions': array([ 15.03182411], dtype=float32)},
 {'predictions': array([ 21.3934021], dtype=float32)},
 {'predictions': array([ 24.41699791], dtype=float32)},
 {'predictions': array([ 21.62764168], dtype=float32)},
 {'predictions': array([ 27.45862007], dtype=float32)},
 {'predictions': array([ 18.09328461], dtype=float32)},
 {'predictions': array([ 24.71727371], dtype=float32)},
 {'predictions': array([ 26.43048859], dtype=float32)},
 {'predictions': array([ 31.88986397], dtype=float32)},
 {'predictions': array([ 12.05979633], dtype=float32)},
 {'predictions': array([ 28.06815529], dtype=float32)},
 {'predictions': array([ 14.69469357], dtype=float32)},
 {'predictions': array([ 17.23473358], dtype=float32)},
 {'predictions': array([ 14.99722099], dtype=float32)},
 {'predictions': array([ 31.97871208], dtype=float32)},
 {'predictions': array([ 13.74249554], dtype=float32)},
 {'predictions': array([ 12.55926514], dtype=float32)},
 {'predictions': array([ 22.09847832], dtype=float32)},
 {'predictions': array([ 18.72144127], dtype=float32)},
 {'predictions': array([ 32.81822968], dtype=float32)},
 {'predictions': array([ 25.44108963], dtype=float32)},
 {'predictions': array([ 17.76109695], dtype=float32)},
 {'predictions': array([ 12.11195374], dtype=float32)},
 {'predictions': array([ 14.76176643], dtype=float32)},
 {'predictions': array([ 17.40787506], dtype=float32)},
 {'predictions': array([ 33.67160416], dtype=float32)},
 {'predictions': array([ 9.57756901], dtype=float32)},
 {'predictions': array([ 34.27106476], dtype=float32)},
 {'predictions': array([ 12.6208353], dtype=float32)},
 {'predictions': array([ 30.40769958], dtype=float32)},
 {'predictions': array([ 14.29025841], dtype=float32)},
 {'predictions': array([ 21.38726616], dtype=float32)},
 {'predictions': array([ 30.26033783], dtype=float32)},
 {'predictions': array([ 22.79364967], dtype=float32)}]
In [26]:
# Predictions
predictions = linear_model.predict(input_fn=eval_input_func)
In [27]:
pred = list(predictions)
INFO:tensorflow:Restoring parameters from C:\Users\AD1026~1\AppData\Local\Temp\tmprfsb8150\model.ckpt-2000
In [28]:
# Get Predicted Values as an Array
predicted_vals = []

for pred in linear_model.predict(input_fn=eval_input_func):
    predicted_vals.append(pred['predictions'])
INFO:tensorflow:Restoring parameters from C:\Users\AD1026~1\AppData\Local\Temp\tmprfsb8150\model.ckpt-2000
In [29]:
print(predicted_vals)
[array([ 37.04899216], dtype=float32), array([ 26.38247681], dtype=float32), array([ 13.78154087], dtype=float32), array([ 13.09169865], dtype=float32), array([ 31.60310364], dtype=float32), array([ 32.12142181], dtype=float32), array([ 33.36090851], dtype=float32), array([ 11.7517662], dtype=float32), array([ 30.0511837], dtype=float32), array([ 10.83946228], dtype=float32), array([ 29.89947319], dtype=float32), array([ 14.20927906], dtype=float32), array([ 20.44610214], dtype=float32), array([ 15.21302795], dtype=float32), array([ 25.54910088], dtype=float32), array([ 18.84660339], dtype=float32), array([ 9.6119709], dtype=float32), array([ 32.46287918], dtype=float32), array([ 30.16629219], dtype=float32), array([ 25.03372192], dtype=float32), array([ 11.44951248], dtype=float32), array([ 21.86482239], dtype=float32), array([ 24.62771416], dtype=float32), array([ 20.55546188], dtype=float32), array([ 32.608181], dtype=float32), array([ 14.41128349], dtype=float32), array([ 35.99029541], dtype=float32), array([ 17.35890198], dtype=float32), array([ 28.69205093], dtype=float32), array([ 31.28341103], dtype=float32), array([ 18.55209923], dtype=float32), array([ 21.08512878], dtype=float32), array([ 34.10903168], dtype=float32), array([ 46.23236084], dtype=float32), array([ 31.59113693], dtype=float32), array([ 24.6950264], dtype=float32), array([ 11.75291157], dtype=float32), array([ 19.30218315], dtype=float32), array([ 4.54955482], dtype=float32), array([ 32.83533859], dtype=float32), array([ 25.94518661], dtype=float32), array([ 15.33049965], dtype=float32), array([ 33.18548965], dtype=float32), array([ 13.01087952], dtype=float32), array([ 14.65274811], dtype=float32), array([ 24.9969635], dtype=float32), array([ 30.81731224], dtype=float32), array([ 15.91858768], dtype=float32), array([ 26.19374657], dtype=float32), array([ 19.94781303], dtype=float32), array([ 29.539711], dtype=float32), array([ 30.56033707], dtype=float32), array([ 22.70759583], dtype=float32), array([ 19.79312706], dtype=float32), array([ 28.57951927], dtype=float32), array([ 5.47840691], dtype=float32), array([ 22.15537834], dtype=float32), array([ 19.82237244], dtype=float32), array([ 30.01177597], dtype=float32), array([ 22.37309074], dtype=float32), array([ 27.37680817], dtype=float32), array([ 7.53720951], dtype=float32), array([ 17.90460014], dtype=float32), array([ 19.90116882], dtype=float32), array([ 9.71079445], dtype=float32), array([ 24.09114265], dtype=float32), array([ 25.39837646], dtype=float32), array([ 21.74806213], dtype=float32), array([ 15.03182411], dtype=float32), array([ 21.3934021], dtype=float32), array([ 24.41699791], dtype=float32), array([ 21.62764168], dtype=float32), array([ 27.45862007], dtype=float32), array([ 18.09328461], dtype=float32), array([ 24.71727371], dtype=float32), array([ 26.43048859], dtype=float32), array([ 31.88986397], dtype=float32), array([ 12.05979633], dtype=float32), array([ 28.06815529], dtype=float32), array([ 14.69469357], dtype=float32), array([ 17.23473358], dtype=float32), array([ 14.99722099], dtype=float32), array([ 31.97871208], dtype=float32), array([ 13.74249554], dtype=float32), array([ 12.55926514], dtype=float32), array([ 22.09847832], dtype=float32), array([ 18.72144127], dtype=float32), array([ 32.81822968], dtype=float32), array([ 25.44108963], dtype=float32), array([ 17.76109695], dtype=float32), array([ 12.11195374], dtype=float32), array([ 14.76176643], dtype=float32), array([ 17.40787506], dtype=float32), array([ 33.67160416], dtype=float32), array([ 9.57756901], dtype=float32), array([ 34.27106476], dtype=float32), array([ 12.6208353], dtype=float32), array([ 30.40769958], dtype=float32), array([ 14.29025841], dtype=float32), array([ 21.38726616], dtype=float32), array([ 30.26033783], dtype=float32), array([ 22.79364967], dtype=float32)]