Help with my training dataSKNN regression problemWhat ML/DL approach better suits this problem?Categorical Variable Reduction using NNTensorflow regression predicting 1 for all inputsNeural network accuracy for simple classificationSimple prediction with KerasTraining Accuracy stuck in KerasSteps taking too long to completeSolving an ODE using neural networks (via Tensorflow)Something is disastrously wrong with my neural network and what it's produced

How should I tell my manager I'm not paying for an optional after work event I'm not going to?

Nested loops to process groups of pictures

Is there an age requirement to play in Adventurers League?

Why symmetry transformations have to commute with Hamiltonian?

Why does sound not move through a wall?

Python 3 - simple temperature program

What do I do if my advisor made a mistake?

Agena docking and RCS Brakes in First Man

When an imagined world resembles or has similarities with a famous world

Feasibility of lava beings?

Voltage Balun 1:1

SOQL query WHERE filter by specific months

How do I calculate how many of an item I'll have in this inventory system?

ListPointPlot3D filling between two lists

Is it normal for gliders not to have attitude indicators?

What to use instead of cling film to wrap pastry

Any examples of liquids volatile at room temp but non-flammable?

How to pass hash as password to ssh server

Will 700 more planes a day fly because of the Heathrow expansion?

Which US defense organization would respond to an invasion like this?

Why do people keep telling me that I am a bad photographer?

Should I mention being denied entry to UK due to a confusion in my Visa and Ticket bookings?

Is there a word that describes the unjustified use of a more complex word?

Is there precedent or are there procedures for a US president refusing to concede to an electoral defeat?



Help with my training data


SKNN regression problemWhat ML/DL approach better suits this problem?Categorical Variable Reduction using NNTensorflow regression predicting 1 for all inputsNeural network accuracy for simple classificationSimple prediction with KerasTraining Accuracy stuck in KerasSteps taking too long to completeSolving an ODE using neural networks (via Tensorflow)Something is disastrously wrong with my neural network and what it's produced













1












$begingroup$


I'm working on my first NN following a tensorflow tut and trying to use my own data.
After about 80 attempts of formatting my data and trying to load it into a dataset to train I'm throwing the towel.



Here is how my data currently looks



syslog_data = [
[302014,0,0,63878,30,3,1], [302014,0,0,3891,0,0,0], [302014,0,0,15928,0,0,2], [305013,5,0,123,99999,0,3],
[302014,0,0,5185,0,0,0], [305013,5,0,123,99999,0,3], [302014,0,0,56085,0,0,0], [110002,4,2,50074,99999,0,4],


In this the last item in each list is the label.
If you can tell me if I need to reformat my data and how or just how to get it loaded into a dataset properly.



Thanks for any help or advice you can give



Here is the full code:



import tensorflow as tf
import numpy as np
from tensorflow.keras import layers
from . import syslog

print(tf.VERSION)
print(tf.keras.__version__)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation='relu'))
# Add another:
model.add(layers.Dense(64, activation='relu'))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation='softmax'))

model.compile(optimizer=tf.train.AdamOptimizer(0.001),
loss='categorical_crossentropy',
metrics=['accuracy'])

dataset = tf.data.dataset.from_tensor_slices(syslog)

model.fit(dataset, epochs=10, steps_per_epoch=30)









share|improve this question











$endgroup$











  • $begingroup$
    WElcome to Data Science SE! Which tutorial did you follow? What error are you actually getting? Have you read the Keras documentation? Or the relevant Tensorflow docs for from_tensor_slices?
    $endgroup$
    – n1k31t4
    Apr 25 at 19:15










  • $begingroup$
    Ive followed about 15 :/ but this one is the most relevant tensorflow.org/guide/keras I have received a number of errors from different attempts. the most recent is this - got shape [8972], but wanted [8972, 1]. from this code dataset = tf.data.Dataset.from_tensor_slices((data, labels)). Im pretty lost on what my training data should look like and how i should import it.
    $endgroup$
    – Alex F
    Apr 25 at 19:23










  • $begingroup$
    I can reformat as needed, I just dont know what to do
    $endgroup$
    – Alex F
    Apr 25 at 19:24















1












$begingroup$


I'm working on my first NN following a tensorflow tut and trying to use my own data.
After about 80 attempts of formatting my data and trying to load it into a dataset to train I'm throwing the towel.



Here is how my data currently looks



syslog_data = [
[302014,0,0,63878,30,3,1], [302014,0,0,3891,0,0,0], [302014,0,0,15928,0,0,2], [305013,5,0,123,99999,0,3],
[302014,0,0,5185,0,0,0], [305013,5,0,123,99999,0,3], [302014,0,0,56085,0,0,0], [110002,4,2,50074,99999,0,4],


In this the last item in each list is the label.
If you can tell me if I need to reformat my data and how or just how to get it loaded into a dataset properly.



Thanks for any help or advice you can give



Here is the full code:



import tensorflow as tf
import numpy as np
from tensorflow.keras import layers
from . import syslog

print(tf.VERSION)
print(tf.keras.__version__)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation='relu'))
# Add another:
model.add(layers.Dense(64, activation='relu'))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation='softmax'))

model.compile(optimizer=tf.train.AdamOptimizer(0.001),
loss='categorical_crossentropy',
metrics=['accuracy'])

dataset = tf.data.dataset.from_tensor_slices(syslog)

model.fit(dataset, epochs=10, steps_per_epoch=30)









share|improve this question











$endgroup$











  • $begingroup$
    WElcome to Data Science SE! Which tutorial did you follow? What error are you actually getting? Have you read the Keras documentation? Or the relevant Tensorflow docs for from_tensor_slices?
    $endgroup$
    – n1k31t4
    Apr 25 at 19:15










  • $begingroup$
    Ive followed about 15 :/ but this one is the most relevant tensorflow.org/guide/keras I have received a number of errors from different attempts. the most recent is this - got shape [8972], but wanted [8972, 1]. from this code dataset = tf.data.Dataset.from_tensor_slices((data, labels)). Im pretty lost on what my training data should look like and how i should import it.
    $endgroup$
    – Alex F
    Apr 25 at 19:23










  • $begingroup$
    I can reformat as needed, I just dont know what to do
    $endgroup$
    – Alex F
    Apr 25 at 19:24













1












1








1





$begingroup$


I'm working on my first NN following a tensorflow tut and trying to use my own data.
After about 80 attempts of formatting my data and trying to load it into a dataset to train I'm throwing the towel.



Here is how my data currently looks



syslog_data = [
[302014,0,0,63878,30,3,1], [302014,0,0,3891,0,0,0], [302014,0,0,15928,0,0,2], [305013,5,0,123,99999,0,3],
[302014,0,0,5185,0,0,0], [305013,5,0,123,99999,0,3], [302014,0,0,56085,0,0,0], [110002,4,2,50074,99999,0,4],


In this the last item in each list is the label.
If you can tell me if I need to reformat my data and how or just how to get it loaded into a dataset properly.



Thanks for any help or advice you can give



Here is the full code:



import tensorflow as tf
import numpy as np
from tensorflow.keras import layers
from . import syslog

print(tf.VERSION)
print(tf.keras.__version__)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation='relu'))
# Add another:
model.add(layers.Dense(64, activation='relu'))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation='softmax'))

model.compile(optimizer=tf.train.AdamOptimizer(0.001),
loss='categorical_crossentropy',
metrics=['accuracy'])

dataset = tf.data.dataset.from_tensor_slices(syslog)

model.fit(dataset, epochs=10, steps_per_epoch=30)









share|improve this question











$endgroup$




I'm working on my first NN following a tensorflow tut and trying to use my own data.
After about 80 attempts of formatting my data and trying to load it into a dataset to train I'm throwing the towel.



Here is how my data currently looks



syslog_data = [
[302014,0,0,63878,30,3,1], [302014,0,0,3891,0,0,0], [302014,0,0,15928,0,0,2], [305013,5,0,123,99999,0,3],
[302014,0,0,5185,0,0,0], [305013,5,0,123,99999,0,3], [302014,0,0,56085,0,0,0], [110002,4,2,50074,99999,0,4],


In this the last item in each list is the label.
If you can tell me if I need to reformat my data and how or just how to get it loaded into a dataset properly.



Thanks for any help or advice you can give



Here is the full code:



import tensorflow as tf
import numpy as np
from tensorflow.keras import layers
from . import syslog

print(tf.VERSION)
print(tf.keras.__version__)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation='relu'))
# Add another:
model.add(layers.Dense(64, activation='relu'))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation='softmax'))

model.compile(optimizer=tf.train.AdamOptimizer(0.001),
loss='categorical_crossentropy',
metrics=['accuracy'])

dataset = tf.data.dataset.from_tensor_slices(syslog)

model.fit(dataset, epochs=10, steps_per_epoch=30)






python tensorflow






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 25 at 19:27









Juan Esteban de la Calle

1,10324




1,10324










asked Apr 25 at 18:38









Alex FAlex F

305




305











  • $begingroup$
    WElcome to Data Science SE! Which tutorial did you follow? What error are you actually getting? Have you read the Keras documentation? Or the relevant Tensorflow docs for from_tensor_slices?
    $endgroup$
    – n1k31t4
    Apr 25 at 19:15










  • $begingroup$
    Ive followed about 15 :/ but this one is the most relevant tensorflow.org/guide/keras I have received a number of errors from different attempts. the most recent is this - got shape [8972], but wanted [8972, 1]. from this code dataset = tf.data.Dataset.from_tensor_slices((data, labels)). Im pretty lost on what my training data should look like and how i should import it.
    $endgroup$
    – Alex F
    Apr 25 at 19:23










  • $begingroup$
    I can reformat as needed, I just dont know what to do
    $endgroup$
    – Alex F
    Apr 25 at 19:24
















  • $begingroup$
    WElcome to Data Science SE! Which tutorial did you follow? What error are you actually getting? Have you read the Keras documentation? Or the relevant Tensorflow docs for from_tensor_slices?
    $endgroup$
    – n1k31t4
    Apr 25 at 19:15










  • $begingroup$
    Ive followed about 15 :/ but this one is the most relevant tensorflow.org/guide/keras I have received a number of errors from different attempts. the most recent is this - got shape [8972], but wanted [8972, 1]. from this code dataset = tf.data.Dataset.from_tensor_slices((data, labels)). Im pretty lost on what my training data should look like and how i should import it.
    $endgroup$
    – Alex F
    Apr 25 at 19:23










  • $begingroup$
    I can reformat as needed, I just dont know what to do
    $endgroup$
    – Alex F
    Apr 25 at 19:24















$begingroup$
WElcome to Data Science SE! Which tutorial did you follow? What error are you actually getting? Have you read the Keras documentation? Or the relevant Tensorflow docs for from_tensor_slices?
$endgroup$
– n1k31t4
Apr 25 at 19:15




$begingroup$
WElcome to Data Science SE! Which tutorial did you follow? What error are you actually getting? Have you read the Keras documentation? Or the relevant Tensorflow docs for from_tensor_slices?
$endgroup$
– n1k31t4
Apr 25 at 19:15












$begingroup$
Ive followed about 15 :/ but this one is the most relevant tensorflow.org/guide/keras I have received a number of errors from different attempts. the most recent is this - got shape [8972], but wanted [8972, 1]. from this code dataset = tf.data.Dataset.from_tensor_slices((data, labels)). Im pretty lost on what my training data should look like and how i should import it.
$endgroup$
– Alex F
Apr 25 at 19:23




$begingroup$
Ive followed about 15 :/ but this one is the most relevant tensorflow.org/guide/keras I have received a number of errors from different attempts. the most recent is this - got shape [8972], but wanted [8972, 1]. from this code dataset = tf.data.Dataset.from_tensor_slices((data, labels)). Im pretty lost on what my training data should look like and how i should import it.
$endgroup$
– Alex F
Apr 25 at 19:23












$begingroup$
I can reformat as needed, I just dont know what to do
$endgroup$
– Alex F
Apr 25 at 19:24




$begingroup$
I can reformat as needed, I just dont know what to do
$endgroup$
– Alex F
Apr 25 at 19:24










2 Answers
2






active

oldest

votes


















2












$begingroup$

There are a couple of problems and things you might want to add to your existing script.



Below I separate your example data into two NumPy arrays:



  • input values x

  • labels y

It is also important to make sure they are of type float32, because Tensorflow will complain if you pass it integers (as they otherwise would be interpreted).



The following works for me, the model trains to completion:



import numpy as np
import tensorflow as tf
from tensorflow.keras import layers

syslog_data = [
[302014, 0, 0, 63878, 30, 3, 1],
[302014, 0, 0, 3891, 0, 0, 0],
[302014, 0, 0, 15928, 0, 0, 2],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 5185, 0, 0, 0],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 56085, 0, 0, 0],
[110002, 4, 2, 50074, 99999, 0, 4],
]

print(tf.VERSION)
print(tf.keras.__version__)

x = np.array([arr[:-1] for arr in syslog_data], dtype=np.float32)
y = np.array([arr[-1:] for arr in syslog_data], dtype=np.float32)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation="relu"))
# Add another:
model.add(layers.Dense(64, activation="relu"))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation="softmax"))

model.compile(optimizer=tf.train.AdamOptimizer(0.001), loss="categorical_crossentropy", metrics=["accuracy"])

model.fit(x, y, epochs=10, steps_per_epoch=30)





share|improve this answer









$endgroup$








  • 1




    $begingroup$
    I know we just met but I love you
    $endgroup$
    – Alex F
    Apr 25 at 19:37


















1












$begingroup$

import keras
import numpy as np
full_data = np.array(syslog_data)
X = full_data[:,:6]
Y = full_data[:,6]
# Convert labels to categorical one-hot encoding
one_hot_labels = keras.utils.to_categorical(Y, num_classes=10)

model.fit(X,Y, epochs=10, steps_per_epoch=30)


Does this work? I think I might be misunderstanding the problem.






share|improve this answer









$endgroup$












  • $begingroup$
    I didnt under stand that it needed to be an array, thank you for replying
    $endgroup$
    – Alex F
    Apr 25 at 19:39











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "557"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f50934%2fhelp-with-my-training-data%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2












$begingroup$

There are a couple of problems and things you might want to add to your existing script.



Below I separate your example data into two NumPy arrays:



  • input values x

  • labels y

It is also important to make sure they are of type float32, because Tensorflow will complain if you pass it integers (as they otherwise would be interpreted).



The following works for me, the model trains to completion:



import numpy as np
import tensorflow as tf
from tensorflow.keras import layers

syslog_data = [
[302014, 0, 0, 63878, 30, 3, 1],
[302014, 0, 0, 3891, 0, 0, 0],
[302014, 0, 0, 15928, 0, 0, 2],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 5185, 0, 0, 0],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 56085, 0, 0, 0],
[110002, 4, 2, 50074, 99999, 0, 4],
]

print(tf.VERSION)
print(tf.keras.__version__)

x = np.array([arr[:-1] for arr in syslog_data], dtype=np.float32)
y = np.array([arr[-1:] for arr in syslog_data], dtype=np.float32)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation="relu"))
# Add another:
model.add(layers.Dense(64, activation="relu"))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation="softmax"))

model.compile(optimizer=tf.train.AdamOptimizer(0.001), loss="categorical_crossentropy", metrics=["accuracy"])

model.fit(x, y, epochs=10, steps_per_epoch=30)





share|improve this answer









$endgroup$








  • 1




    $begingroup$
    I know we just met but I love you
    $endgroup$
    – Alex F
    Apr 25 at 19:37















2












$begingroup$

There are a couple of problems and things you might want to add to your existing script.



Below I separate your example data into two NumPy arrays:



  • input values x

  • labels y

It is also important to make sure they are of type float32, because Tensorflow will complain if you pass it integers (as they otherwise would be interpreted).



The following works for me, the model trains to completion:



import numpy as np
import tensorflow as tf
from tensorflow.keras import layers

syslog_data = [
[302014, 0, 0, 63878, 30, 3, 1],
[302014, 0, 0, 3891, 0, 0, 0],
[302014, 0, 0, 15928, 0, 0, 2],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 5185, 0, 0, 0],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 56085, 0, 0, 0],
[110002, 4, 2, 50074, 99999, 0, 4],
]

print(tf.VERSION)
print(tf.keras.__version__)

x = np.array([arr[:-1] for arr in syslog_data], dtype=np.float32)
y = np.array([arr[-1:] for arr in syslog_data], dtype=np.float32)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation="relu"))
# Add another:
model.add(layers.Dense(64, activation="relu"))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation="softmax"))

model.compile(optimizer=tf.train.AdamOptimizer(0.001), loss="categorical_crossentropy", metrics=["accuracy"])

model.fit(x, y, epochs=10, steps_per_epoch=30)





share|improve this answer









$endgroup$








  • 1




    $begingroup$
    I know we just met but I love you
    $endgroup$
    – Alex F
    Apr 25 at 19:37













2












2








2





$begingroup$

There are a couple of problems and things you might want to add to your existing script.



Below I separate your example data into two NumPy arrays:



  • input values x

  • labels y

It is also important to make sure they are of type float32, because Tensorflow will complain if you pass it integers (as they otherwise would be interpreted).



The following works for me, the model trains to completion:



import numpy as np
import tensorflow as tf
from tensorflow.keras import layers

syslog_data = [
[302014, 0, 0, 63878, 30, 3, 1],
[302014, 0, 0, 3891, 0, 0, 0],
[302014, 0, 0, 15928, 0, 0, 2],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 5185, 0, 0, 0],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 56085, 0, 0, 0],
[110002, 4, 2, 50074, 99999, 0, 4],
]

print(tf.VERSION)
print(tf.keras.__version__)

x = np.array([arr[:-1] for arr in syslog_data], dtype=np.float32)
y = np.array([arr[-1:] for arr in syslog_data], dtype=np.float32)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation="relu"))
# Add another:
model.add(layers.Dense(64, activation="relu"))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation="softmax"))

model.compile(optimizer=tf.train.AdamOptimizer(0.001), loss="categorical_crossentropy", metrics=["accuracy"])

model.fit(x, y, epochs=10, steps_per_epoch=30)





share|improve this answer









$endgroup$



There are a couple of problems and things you might want to add to your existing script.



Below I separate your example data into two NumPy arrays:



  • input values x

  • labels y

It is also important to make sure they are of type float32, because Tensorflow will complain if you pass it integers (as they otherwise would be interpreted).



The following works for me, the model trains to completion:



import numpy as np
import tensorflow as tf
from tensorflow.keras import layers

syslog_data = [
[302014, 0, 0, 63878, 30, 3, 1],
[302014, 0, 0, 3891, 0, 0, 0],
[302014, 0, 0, 15928, 0, 0, 2],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 5185, 0, 0, 0],
[305013, 5, 0, 123, 99999, 0, 3],
[302014, 0, 0, 56085, 0, 0, 0],
[110002, 4, 2, 50074, 99999, 0, 4],
]

print(tf.VERSION)
print(tf.keras.__version__)

x = np.array([arr[:-1] for arr in syslog_data], dtype=np.float32)
y = np.array([arr[-1:] for arr in syslog_data], dtype=np.float32)

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation="relu"))
# Add another:
model.add(layers.Dense(64, activation="relu"))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation="softmax"))

model.compile(optimizer=tf.train.AdamOptimizer(0.001), loss="categorical_crossentropy", metrics=["accuracy"])

model.fit(x, y, epochs=10, steps_per_epoch=30)






share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 25 at 19:35









n1k31t4n1k31t4

6,8712422




6,8712422







  • 1




    $begingroup$
    I know we just met but I love you
    $endgroup$
    – Alex F
    Apr 25 at 19:37












  • 1




    $begingroup$
    I know we just met but I love you
    $endgroup$
    – Alex F
    Apr 25 at 19:37







1




1




$begingroup$
I know we just met but I love you
$endgroup$
– Alex F
Apr 25 at 19:37




$begingroup$
I know we just met but I love you
$endgroup$
– Alex F
Apr 25 at 19:37











1












$begingroup$

import keras
import numpy as np
full_data = np.array(syslog_data)
X = full_data[:,:6]
Y = full_data[:,6]
# Convert labels to categorical one-hot encoding
one_hot_labels = keras.utils.to_categorical(Y, num_classes=10)

model.fit(X,Y, epochs=10, steps_per_epoch=30)


Does this work? I think I might be misunderstanding the problem.






share|improve this answer









$endgroup$












  • $begingroup$
    I didnt under stand that it needed to be an array, thank you for replying
    $endgroup$
    – Alex F
    Apr 25 at 19:39















1












$begingroup$

import keras
import numpy as np
full_data = np.array(syslog_data)
X = full_data[:,:6]
Y = full_data[:,6]
# Convert labels to categorical one-hot encoding
one_hot_labels = keras.utils.to_categorical(Y, num_classes=10)

model.fit(X,Y, epochs=10, steps_per_epoch=30)


Does this work? I think I might be misunderstanding the problem.






share|improve this answer









$endgroup$












  • $begingroup$
    I didnt under stand that it needed to be an array, thank you for replying
    $endgroup$
    – Alex F
    Apr 25 at 19:39













1












1








1





$begingroup$

import keras
import numpy as np
full_data = np.array(syslog_data)
X = full_data[:,:6]
Y = full_data[:,6]
# Convert labels to categorical one-hot encoding
one_hot_labels = keras.utils.to_categorical(Y, num_classes=10)

model.fit(X,Y, epochs=10, steps_per_epoch=30)


Does this work? I think I might be misunderstanding the problem.






share|improve this answer









$endgroup$



import keras
import numpy as np
full_data = np.array(syslog_data)
X = full_data[:,:6]
Y = full_data[:,6]
# Convert labels to categorical one-hot encoding
one_hot_labels = keras.utils.to_categorical(Y, num_classes=10)

model.fit(X,Y, epochs=10, steps_per_epoch=30)


Does this work? I think I might be misunderstanding the problem.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 25 at 19:38









Andy MAndy M

1965




1965











  • $begingroup$
    I didnt under stand that it needed to be an array, thank you for replying
    $endgroup$
    – Alex F
    Apr 25 at 19:39
















  • $begingroup$
    I didnt under stand that it needed to be an array, thank you for replying
    $endgroup$
    – Alex F
    Apr 25 at 19:39















$begingroup$
I didnt under stand that it needed to be an array, thank you for replying
$endgroup$
– Alex F
Apr 25 at 19:39




$begingroup$
I didnt under stand that it needed to be an array, thank you for replying
$endgroup$
– Alex F
Apr 25 at 19:39

















draft saved

draft discarded
















































Thanks for contributing an answer to Data Science Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f50934%2fhelp-with-my-training-data%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020