
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 668 Articles for Machine Learning

282 Views
Let us suppose you have given a dataset with various variables and data points thus in order to plot the cluster map for the given data points we can use Clustermaps class.In this example, we will import the wine quality dataset from the https://archive.ics.uci.edu/ml/datasets/wine+quality.import matplotlib.pyplot as plt import numpy as np import seaborn as sns sns.set(style='white') #Import the dataset wine_quality = pd.read_csv(‘winequality-red.csv’ delimeter=‘;’)Let us suppose we have raw data of wine Quality datasets and associated correlation matrix data.Now let us plot the clustermap of the data, row_colors = wine_quality["quality"].map(dict(zip(wine_quality["quality"].unique(), "rbg"))) g = sns.clustermap(wine_quality.drop('quality', axis=1), standard_scale=1, robust=True, row_colors=row_colors, cmap='viridis')Plot the ... Read More

613 Views
To customize the color and colormaps of a plot, we can use the colormap property from the color library. There are two types of colormap we can create: (a) discrete colormap and (b) continuous colormap.We will first see how to create a discrete colormap followed by continuous colormap.In the example, we will use ‘iris’ dataset to create three plots such that the first plot uses the default colormap and the other two uses RGB map to create a mixed colored plot. However, we can create as many color maps as we have clusters.Exampleimport matplotlib.pyplot as plt import pandas as pd ... Read More

939 Views
When we plot a figure in Matplotlib, it creates four spines around the figure, top, left, bottom and right. Spines are nothing but a box surrounded with the pictorial representation of the grid which displays some ticks and tickable axes on left(y) and bottom(x).Let us see how to customize the spines in a given figure. We will create six figures to see and customize the spines for it.First import the required libraries for the workbook.import numpy as np import matplotlib.pyplot as pltLet us draw graph for sines, theta = np.linspace(0, 2*np.pi, 128) y = np.sin(theta) fig = plt.figure(figsize=(8, 6))Define the ... Read More

856 Views
To create a custom marker on a plot or graph, we use a list where we write the markers we want to see in the plot. The markers are nothing but symbols, emoji, character or any character which we want to see on the figure.In order to create the marker, we will first import the required libraries.import matplotlib.pyplot as plt import numpy as npFor now, we will create a marker on a sine curve. Let us create the grid with size (12, 6), x = np.arange(1, 2.6, 0.1) y = np.sin(2 * np.pi * x) plt.subplots(figsize=(12, 6))Here we will create ... Read More

971 Views
Aligning the multiple plots in a grid can be very messy and it can create multiple issues like higher width and height or minimal width to align all the plots. In order to align all the plots in a grid, we use GridSpec class.Let us suppose that we have a bar graph plot and we want to align the symmetry of the plot in this sample.First Import all the necessary libraries and plot some graphs in two grids. Then, we will plot a constant error bar and a symmetric and asymmetric error bar on the first grid. In the second ... Read More

434 Views
To specify the details of a plot, we use annotations. To create annotations in Matplotlib Plots, we can use the ‘annotate’ method.Exampleimport matplotlib.pyplot as plt import numpy as np #Let us create a plot and use annotation at the point (5,3), x = np.arange(0,4*np.pi,0.1) plt.plot(np.sin(x), 'b-*') a = plt.annotate("(3,0)", xy=(3, 0), xycoords='data', xytext=(4.0,0.5), textcoords='data', arrowprops=dict(arrowstyle="->", color="green", lw=5, connectionstyle=("arc3,rad=0."))) plt.setp(a, size=25) #Display the plot plt.show()Output

534 Views
After enabling the pick event property of artists in Matplotlib, the task is to use the pick event to enable and disable the line plots for a given axis in a set of plots.In order to pick a specific line plot, we use Legend.We will use a Binary classification plot to create the ROC Curve. ROC curve or Receiver Operating Characteristics curve is used for diagnostics, weather prediction and other applications. It contains True Negative Rate (TPR) and False Positive Rate (FPR). Using ROC, we will create multiple plots of the curve.Let us Import the libraries first. Here ‘nbAgg’ is used ... Read More

196 Views
TensorFlow Text contains collection of text related classes and ops that can be used with TensorFlow 2.0. The library helps in pre-processing which is required by text-based models, and includes other features that are needed for sequence modelling. These features are not present in TensorFlow.Using the ops during text pre-processing is similar to working with Tensorflow graph. This means the user wouldn’t need to worry about tokenization in training being different from tokenization at interference. Ops also helps in managing pre-processing scripts.It can be installed using the below command:pip install -q tensorflow-textTensorFlow Text requires TensorFlow 2.0, and is compatible with ... Read More

313 Views
A neural network that contains at least one layer is known as a convolutional layer. A convolutional neural network would generally consist of some combination of the below mentioned layers:Convolutional layersPooling layersDense layersConvolutional Neural Networks have been used to produce great results for a specific kind of problems, such as image recognition. It is a Deep Learning algorithm that takes an image as input, assigns importance to it, i.e. the algorithm learns to assign weights and biases to values. This helps differentiate one object from the other.The amount of pre-processing required in a ConvNet is lesser than other classification algorithms. ... Read More

405 Views
The flower dataset can be downloaded using a google API that basically links to the flower dataset. The ‘get_file’ method can be used to pass the API as a parameter. Once this is done, the data gets downloaded into the environment.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 Colaboratory helps run Python code ... Read More