Skip to content
Snippets Groups Projects
Commit 5a6f02be authored by Nancy Polanyk's avatar Nancy Polanyk
Browse files

Beginning to build model.

parent 6e364dc5
No related merge requests found
...@@ -48,5 +48,41 @@ pad = np.zeros((160,4)) ...@@ -48,5 +48,41 @@ pad = np.zeros((160,4))
temp = np.concatenate((temperature_data,pad),axis=1) temp = np.concatenate((temperature_data,pad),axis=1)
temp = np.reshape(temp,(160,5)) temp = np.reshape(temp,(160,5))
data_points = np.concatenate((ph,moisture_data,temp),axis=0) #don't need this
# data_points = np.concatenate((ph,moisture_data,temp),axis=0)
# print(data_points)
#just put the data into a array of (160,3,5)
# [[[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]],
# [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]..]
# print(ph[0])
# print(temp[0])
# print(moisture_data[0])
data_points = np.zeros((160,3,5))
# print(data_points[0])
#first array set
print(data_points[0])
#first array - in array
print(data_points[0][0])
# data_points[0] = [ph[0],moisture_data[0],temp[0]]
# print(data_points[0])
for i in range(160):
data_points[i] = [ph[i],moisture_data[i],temp[i]]
print(data_points) print(data_points)
#Splitting the dataset into testing & training
from sklearn.model_selection import train_test_split
train_data, test_data, train_labels, test_labels = train_test_split(data_points,plants, test_size=0.3, random_state = 737)
#print(train_data)
train_data = np.asarray(train_data).astype(np.float32)
test_data = np.asarray(test_data).astype(np.float32)
print(train_labels.dtypes)
print(train_data.dtype)
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