---
title: "Discussion on \"Build, Compile, and Fit Models in TensorFlow \nPart II\" | Hashnode"
description: "Discussion on \"Build, Compile, and Fit Models in TensorFlow \nPart II\". Fitting models in TensorFlow"
url: "https://hashnode.com/posts/build-compile-and-fit-models-in-tensorflow-part-ii/64dad1c9ff6c76c54a36b6e4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Build, Compile, and Fit Models in TensorFlow Part II](https://arthurkaza.com/build-compile-and-fit-models-in-tensorflow-part-ii?utm_source=hashnode&utm_medium=feed)

Fitting models in TensorFlow

Aug 15, 2023 · 7 min read · arthurkaza.com  
Updated Oct 3, 2023  
Read the article

-   [#tensorflow](https://hashnode.com/tag/tensorflow)
-   [#google](https://hashnode.com/tag/google)
-   [#google-developer](https://hashnode.com/tag/google-developer)
-   [#python](https://hashnode.com/tag/python)
-   [#machine-learning](https://hashnode.com/tag/machine-learning)

## Written by

[Arthur Kaza](https://hashnode.com/@ArthurStarks)

@ArthurStarks · Kinshasa, DRC

  
[View profile](https://hashnode.com/@ArthurStarks)

Senior Data Scientist | Google Developer Expert AI

Senior Data Scientist with over 8 years of international experience in Finance AI scoring systems and risk analysis, specializing in the design and optimization of information systems, loan scoring model, data science, and AI. As a AI researcher, he works on Computer Vision applications to Energy resize and Cache Generated Augmented Architecture applications for protected culture and languages. Arthur Kaza is recognized as a Google Developer Expert in Machine Learning (AI) by Google for his significant contributions to AI in Google communities in his region, with nearly 5 years of experience designing technological learning programs, hackathons, and mentorship. A true technology enthusiast and community leader, he has mentored over 100 young professionals in technological learning programs he managed across Central and East Africa.

## Responses 2

Markdown supported · ⌘↵ to post

[Arthur Kaza](https://hashnode.com/@ArthurStarks)

[Aug 23, 2023](https://hashnode.com/posts/build-compile-and-fit-models-in-tensorflow-part-ii/64dad1c9ff6c76c54a36b6e4/comment/64e676bccae237eabaabaeee)

This will cause an error because the model wouldn’t know what to learn from during training. You are right, it means that I was considering data as our input data (x) and target (y) at the same time.

Both input data (x) and target data (y) are essential for the training phase. So, it’s important to split your data into x (features) and y (labels) before training your model. Thanks [A A](https://hashnode.com/@prosson) for the feedback next time I will pay attention to be more clear with that.

[A A](https://hashnode.com/@prosson)

[Aug 19, 2023](https://hashnode.com/posts/build-compile-and-fit-models-in-tensorflow-part-ii/64dad1c9ff6c76c54a36b6e4/comment/64e0e525fe582aa061c407c5)

Good example but this line will error:

model.fit(data, epochs=10)

It needs to be split into x and y:

model.fit(x\_train, y\_train, epochs=10)
