Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

keras
model
machine learning
deep learning

What is model predict in Keras?

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keras is a high-level, deep learning API written in Python. It uses a simplistic API to a make model, train it, and then use it for prediction. In this shot, we’ll talk about prediction.

Read more about Keras here.

The Keras model class API provides the method model.predict(). The syntax below is from the TensorFlow implementation of Keras.

Syntax

model.predict(
    x, batch_size=None, verbose=0, steps=None, callbacks=None
)
  • x: Input samples. Can be a NumPy array or a TensorFlow tensor.
  • batch_size: Number of samples per batch, Integer or None.
  • verbose: Verbosity mode, 00 or 11.
  • steps: Number of steps (batches of samples) before finishing the prediction. Ignored with the default value of None.
  • callbacks: List of callbacks to apply during prediction.

Returns the predictions as a NumPy array.

RELATED TAGS

keras
model
machine learning
deep learning
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring