Found 33676 Articles for Programming

What is Python's OS Module

S Vijay Balaji
Updated on 11-Feb-2021 06:47:49

2K+ Views

IntroductionThe OS module in Python comes with various functions that enables developers to interact with the Operating system that they are currently working on. In this article we’ll be learning mainly to create and delete a directory/folder, rename a directory and even basics of file handling.Without further ado, let’s get started.Getting StartedPython’s OS module comes packaged within python when installed. This means you do not need to separately install it using PIP. In order to access its various methods/functions, you just need to import the module.import osNow that you’ve imported the module, you can start using its various functions.Getting current ... Read More

How can Tensorflow be used to build a normalization layer for the abalone dataset?

AmitDiwan
Updated on 19-Feb-2021 18:07:01

181 Views

A normalization layer can be built using the ‘Normalization’ method present in the ‘preprocessing’ module. This layer is made to adapt to the features of the abalone dataset. In addition to this, a dense layer is added to improve the training capacity of the model. This layer will help pre-compute the mean and variance associated with every column. This mean and variance values will be used to normalize the data.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the abalone dataset, which contains a set of measurements of abalone. Abalone is ... Read More

Reading and writing Excel files using the openpyxl module in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:46:38

2K+ Views

Introductionopenpyxl is a Python library to read/write Excel 2010 xlsx/xlsm/xltx/xltm files.It was born from lack of existing library to read/write natively from Python the Office Open XML format.An excel file that we use for operation is called Workbook that contains a minimum of one Sheet and a maximum of tens of sheets.One sheet consists of rows starting from 1 and columns starting from A.Using the openpxyl library, we can perform various functions including adding sheets and data, manipulate and even delete said data.Now that we know what we are dealing with, let us get started.Getting StartedThe openpyxl does not come ... Read More

How can Tensorflow be used with abalone dataset to build a sequential model?

AmitDiwan
Updated on 19-Feb-2021 18:03:30

284 Views

A sequential model can be built in Keras using the ‘Sequential’ method. The number and type of layers are specified inside this method.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the abalone dataset, which contains a set of measurements of abalone. Abalone is a type of sea snail. The goal is to predict the age based on other measurements.We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the browser and requires zero configuration and free access to GPUs (Graphical ... Read More

How can Tensorflow be used to display sample data from abalone dataset?

AmitDiwan
Updated on 19-Feb-2021 17:59:28

206 Views

Once the abalone dataset has been downloaded using the google API, a few samples of the data can be displayed on the console using the ‘head’ method. If a number is passed to this method, that many rows would be displayed. It basically displays the rows from the beginning.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the abalone dataset, which contains a set of measurements of abalone. Abalone is a type of sea snail. The goal is to predict the age based on other measurements.We are using the Google Colaboratory ... Read More

How to validate data using Cerberus in python

S Vijay Balaji
Updated on 11-Feb-2021 06:44:52

2K+ Views

IntroductionThe Cerberus module in python provides powerful yet lightweight data validation functions. It is designed in such a way that you can extend it to various applications and custom validations.We first define a schema and then validate the data against the scheme and check if it matches the provided conditions or not. If not, accurate errors are thrown to display where it went wrong.Various conditions can be applied at once to the data field for validation.Getting startedIn order to use Cerberus, you must first install it, as it does not come packaged with Python.In order to download and install it, ... Read More

How can Tensorflow be used to load the csv data from abalone dataset?

AmitDiwan
Updated on 19-Feb-2021 17:58:05

239 Views

The abalone dataset can be downloaded by using the google API that stores this dataset. The ‘read_csv’ method present in the Pandas library is used to read the data from the API into a CSV file. The names of the features are also specified explicitly.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the abalone dataset, which contains a set of measurements of abalone. Abalone is a type of sea snail. The goal is to predict the age based on other measurements.We are using the Google Colaboratory to run the below ... Read More

How can Tensorflow be used with flower dataset to continue training the model?

AmitDiwan
Updated on 19-Feb-2021 17:55:53

158 Views

To continue training the model on the flower dataset, the ‘fit’ method is used. To this method, the number of epochs (number of times the data is trained to build the model) is also specified. Some of the sample images are also displayed on the console.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the below code. Google Colab or ... Read More

How can Tensorflow be used to configure the flower dataset for performance?

AmitDiwan
Updated on 19-Feb-2021 17:51:07

174 Views

The flower dataset would have given a certain percentage of accuracy when a model is created. If it is required to configure the model for performance, a function is defined that performs the buffer prefetch for the second time, and then it is shuffled. This function is called on the training dataset to improve the performance of the model.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We ... Read More

How to Match patterns and strings using the RegEx module in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:42:22

250 Views

IntroductionThe RegEx module stands for Regular expressions. If you have already worked on programming, you would have come across this term several times already. We use the Regular expressions to search and replace, it is used in various text editors, search engines, word processors, etc.In other words, it helps match a certain pattern that you are looking for.A good example for this would be how your collage website allows you to use only your university mail and none of the other extensions.Getting StartedThe regular expression module comes packaged within Python. You do not need to download and install it separately.In ... Read More

Advertisements