Python

K-Means-Clustering

K-Means Clustering Algorithm in Machine Learning

K-Means clustering is an unsupervised   machine learning algorithm which partitions n instances into k clusters by similarity. As K-Means clustering is an unsupervised learning algorithm, therefore instances will not have labels. As  K-Means clustering  is an unsupervised learning algorithm, training instances will not have labels. Furthermore, to make you understand K-Means clustering algorithm, I will

K-Means Clustering Algorithm in Machine Learning Read More »

K-Nearest-Neighbor-Algorithm

K-Nearest Neighbors Algorithm in Machine Learning

K-Nearest Neighbors algorithm (KNN) K-Nearest Neighbors algorithm (KNN) is a very important supervised machine learning algorithm and one should start from this algorithm. It is easy to understand compare to other algorithms and does not involve complex mathematical concepts. In this post, I will explain k-Nearest Neighbors algorithm using Irish flowers data set.   From

K-Nearest Neighbors Algorithm in Machine Learning Read More »

Covariance and Correlation

Covariance and Correlation

Covariance and Correlation- Covariance and correlation both measure linear relationship between two variables.  However, they differ at some points. In this post I will explain covariance and correlation and how they differ from each other. Covariance between two variables is written as Cov(X,Y) and is defined as Calculation of Covariance If you look at the

Covariance and Correlation Read More »

Object-Oriented-Python

Mathematical Operations in Python using Object-Oriented Programming in Python

Python is an object-oriented language and a class can have properties and methods. In this post, I will create a simple class having a constructor __init__() and four methods namely mysum(), mymul(), mydiv() and mysub(). Moreover, they compute addition of two numbers, multiplication of two numbers, division of a number by another and subtraction  of

Mathematical Operations in Python using Object-Oriented Programming in Python Read More »

K-Nearest Neighbors

K-Nearest Neighbors Algorithm in Python

K-nearest neighbors algorithm is a machine learning algorithm which is used for classification and regression, and it can be applied where other machine learning algorithms are applied. See the typical problem setting , Suppose (x1, y1), (x2, y2), (x3, y3), ……………….(xn, yn) pairs in which x’s are attributes and y’s are labels, suppose another instance

K-Nearest Neighbors Algorithm in Python Read More »

Write a program which opens a CSV file in Python and Reads Data from it

1-import csv 2-fcsv=open(‘mycsv.csv’, ‘r’) 3-table=csv.reader(fcsv) 4-for row in table: 5-          print(row) Program Description In the above program a library csv is imported in the first file which is used to manipulate csv files. Moreover, a file object fcsv is created using open function, thereafter   file object is passed into reader function

Write a program which opens a CSV file in Python and Reads Data from it Read More »

©Postnetwork-All rights reserved.