Some topics in the Machine learning

SARAVANACHANDRU S.K
2 min readJun 6, 2021

In this blog, we are going to learn about the machine learning codes and some of the keywords.

TOPICS:

  • what is the Future code in Python?
  • Why are we using “numpy.random.seed(1337)”?
  • What is “Keras”?
  • what is “mnist”?
  • what is the resolution of the image in mnist?

what is the Future code in Python?

The future module is used to make functional available in the current version of Python even it is available in a future version.

For example, future import with_statement allows users to use the with the statement in Python 2.5 but it is part of the language as of Python 2.6.

Why are we using “numpy.random.seed(1337)”?

NumPy random seed >>simply a function >>> essential input that enables NumPy to generate pseudo-random numbers for random processe

numpy.random.seed() >>> random number predicter

if we didn,t use the numpy.random.seed() function result is changeable for every reload or refresh

Example:
import numpy
array = numpy.random.rand(6)
print (array)

output 1:[0.27630009 0.07400057 0.91911529 0.94244675 0.85141067 0.46344097]
output2:[0.06750042 0.49674223 0.13564903 0.44405918 0.38128537 0.62066691]

If we use the numpy.random.seed() function in the program then result for every outcome is equal

Example:

import numpy
numpy.random.seed(0)
array = numpy.random.rand(6)
print (array)
output:[0.5488135 0.71518937 0.60276338 0.54488318 0.4236548 0.64589411]

What is “Keras”?

Keras is the deep learning API written in python , running on the top of the machine learning platform tensorflow.

what is “mnist”?

MNIST contains 70,000 images of handwritten digits . In this 60,000 for training and 10,000 for testing.The images are grayscale, 28x28 pixels, and centered to reduce preprocessing and get started quicker.

what is the resolution of the image in mnist ?

The resolution of the image in mnist is 28 x 28 pixels.

In this section, we are going to learn about some of the codes using in machine learning programming.

1.“(x_train,y_train),(x_test,y_test)=mnist.load.data()” what is a the meaning of this code ? why we use this code?

In this load.data() — is to load a mnist dataset which has 60,000 images had a 28x28pixel Here, TRAIN is the word that denotes the training dataset value of x by y. Then TEST is to testing a dataset

2. num_classes=10

It is desired dtype Default value = none

3. batch_size?

No.of.training examples per iteration take place. 3 — types: Batch mode — batch size is = Total datasets Mini batch mode — it greater than 1 but lesser than the total dataset Stochastic mode — batch is = 1 and its parameters are updated for each sample

4.epochs= 2

Here epoch — number of times algorithm see the entire data. For example, We have 10 datasets, the batch size is 2 then the epoch is 3, In each epoch, we have 5 batches (10/2) than for per epoch 5 iterations therefore total of 15 iterations take place for the 3 epoch.

--

--