PDS - October 26, 1 - 32 AM
PDS - October 26, 1 - 32 AM
Example 1:
If you have used Netflix, then you must know that it recommends you some movies or
shows for watching based on what you have watched earlier. Machine Learning is used for this
recommendation and to select the data which matches your choice. It uses the earlier data.
Example 2:
The second example would be Facebook.
When you upload a photo on Facebook, it can recognize a person in that photo and
suggest mutual friends. ML is used for these predictions. It uses data like your friend-list,
photos available etc. and it makes predictions based on that.
Example 3:
The third example is Software, which shows how you will look when you get older. This
image processing also uses machine learning.
All these are some examples that help us to understand how machine learning is used.
ML is similar to AI up to some extent, however, there is a difference between the two. It is
related to data mining.
With the help of machine learning, systems make better decisions, at a high speed and
most of the times they are accurate. Using this technique is inexpensive and it can analyze large
and complex data sets.
2. PyTorch
PyTorch is a Torch based, Python machine learning library. The torch is a Lua based
computing framework, scripting language, and machine learning library.
Features:
● It helps in building neural networks through the Autograd Module.
● It provides a variety of optimization algorithms for building neural networks.
● PyTorch can be used on cloud platforms.
● It provides distributed training, various tools, and libraries.
Pros:
● It helps in creating computational graphs.
● Ease of use because of the hybrid front-end.
3.TensorFlow
TensorFlow provides a JavaScript library which helps in machine learning. APIs will
help you to build and train the models.
Features:
● Helps in training and building your models.
● You can run your existing models with the help of TensorFlow.js which is a model converter.
● It helps in the neural network.
Pros:
● You can use it in two ways, i.e. by script tags or by installing through NPM.
● It can even help for human pose estimation.
Cons:
● It is difficult to learn.
4.Weka
These machine learning algorithms help in data mining.
Features:
● Visualization and
● Association rules mining.
Pros:
● Provides online courses for training.
● Easy to understand algorithms.
● It is good for students as well.
Cons:
● Not much documentation and online support are available.
5.KNIME
KNIME is a tool for data analytics, reporting and integration platform. Using the data
pipelining concept, it combines different components for machine learning and data mining.
Features:
● It can integrate the code of programming languages like C, C++, R, Python, Java,
JavaScript etc.
● It can be used for business intelligence, financial data analysis, and CRM.
Pros:
● It can work as a SAS alternative.
● It is easy to deploy and install.
● Easy to learn.
Cons:
● Difficult to build complicated models.
● Limited visualization and exporting capabilities.
6.Colab
Google Colab is a cloud service which supports Python. It will help you in building the
machine learning applications using the libraries of PyTorch, Keras, TensorFlow, and OpenCV
Features:
● It helps in machine learning education.
● Assists in machine learning research.
Pros:
● You can use it from your google drive.
Features:
● It can be used for easy and fast prototyping.
● It supports convolution networks.
● It assists recurrent networks.
● It supports a combination of two networks.
● It can be run on the CPU and GPU.
Pros:
● User-friendly
● Modular
● Extensible
Cons:
● In order to use Keras, you must need TensorFlow, Theano, or CNTK.
8.Rapid Miner
Rapid Miner provides a platform for machine learning, deep learning, data preparation,
text mining, and predictive analytics. It can be used for research, education and application
development.
Features:
● Through GUI, it helps in designing and implementing analytical workflows.
● It helps with data preparation.
● Result Visualization.
● Model validation and optimization.
Pros:
● Extensible through plugins.
● Easy to use.
● No programming skills are required.
Cons:
● The tool is costly.
Understanding / Timely
Involvement Total (10)
Problem solving Completion
(4) (3)
(3)
Signature
VIVA-VOCE QUESTIONS :
1.Is python programming language or scripting language? justify your statement.
2.List the different modes of running python scripts? 3.Mention five benefits of using
Python?
4.List the differences between compiler and interpreter? 5.What are the
supported data types in Python?
6.What is the command line argument?
7.How to represent complex numbers in python?
8.What is the importance of type conversion?
9.How to determine the type of a variable in Python? 10.How to assign multiple values to
variables in a single line in python? 11.How many reserved keywords are there in
python? 12.Write a print statement to display the output Hello”World”Everyone? 13.How
to write multiline statements in python?
14.What is an indentation error with an example?
AIM:
Objective:
∙ To study Python on different platforms.
Program :
a = int(input("enter a number"))
b = int(input("enter a number"))
print("Addition of numbers : ", a + b)
print("Subtraction of numbers : ", a - b)
print("Multiplication of numbers : ", a * b)
print("division of numbers :", a / b)
print("Modulo of numbers a%b : ", a % b)
print("Floor of numbers : ", a // b)
Output :
Objective:
∙ To study Python on different platforms.
Program :
a = int(input("Enter a number"))
if (a % 2 == 0):
print("Number is even")
else:
print("Number is odd")
Output :
EVALUATION:
(3)
Signature
TITLE:
OBJECTIVES: After completing study of this practical the students will be familiarized with...
➢ Concept of Branching Program.
➢ Concept of Iteration.
The Python for loop is an iterator based for loop. It steps through the items of lists, tuples, strings,
the keys of dictionaries and other iterables. The Python for loop starts with the keyword "for"
followed by an arbitrary variable name, which will hold the values of the following sequence
object.
for <variable> in <sequence>:
<statements>
else:
<statements>
Program :
if Statements
The if statement is arguably the most used statement to control loops. For instance:
Program :
Output:
(3)
Signature
● The left triangle star pattern is a star pattern in the shape of a triangle. It is quite easy to create it.
● Steps to create a left triangle star pattern:
o Run a nested for loop where internal loop will run for number of times external loop
has run.
o Print stars in each iteration of the internal loop.
o Print a new line at the end of the internal loop.
o
4.1 Write a python program to find following pattern
Program :
n=6
for i in range (0,n) :
for j in range(0,i+1):
print("*", end=" ")
print()
Output:
o Create a loop that will run for the number of rows (size).
o Inside this we will have 2 loops, first will print spaces and second will print stars. (look at
pattern above)
o Spaces will be printed for size - i times and stars will be printed for i times. Where i is the
current row.
o Print a new line at the end of both internal loops.
*
**
***
****
*****
Program :
height = 5
for row in range(1, height+ 1):
print(" " * (height - row) +"*" * row)
EVALUATION:
(3)
Signature
Program :
Output:
2. Write a python program to check whether the string is in uppercase,lowercase and capitalized first
letter or not
Program :
Output :
(3) (3)
Signature
Data Set
Program :
import warnings
warnings.filterwarnings('ignore')
Output:
Program :
Output :
EVALUATION:
(3)
solving(3)
Program :
from sklearn.model_selection import train_test_split
import pandas as pd
data = pd.read_csv(‘Temp_dataset.csv’)
data.info()
Output:
2. Write a Program to perform how to display top 5 data from .csv dataset using pandas.
Program :
from sklearn.model_selection import train_test_split
import pandas as pd
data = pd.read_csv('Temp_dataset.csv')
data.head()
EVALUATION:
Involvement(4) Understanding Timely
/ Problem Completion Total (10)
(3)
solving(3)
Signature
TITLE: Implement functions to perform conditional operations on data frames using pandas.
Program :
import pandas as pd
input = pd.read_csv("Temp_dataset.csv")
from sklearn.preprocessing import LabelEncoder
input = input.apply(LabelEncoder().fit_transform)
input
Output:
Program :
target = input.apply(LabelEncoder().ft_transform)
target
Output:
(3)
Signature
1. Write a Program to Implement Decision Tree , Random Forest, NB ML models on .csv dataset using
pandas
Program :
Output:
EVALUATION:
(3)
solving(3)
Signature
Program :
import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
plt.scatter(data['company'],data['salary_more_then_50000'])
plt.xlabel("company")
plt.ylabel("Salary")
plt.show()
Output:
Program :
import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
data.columns
cdf=data[['company', 'job', 'degree', 'salary_more_then_50000']]
cdf.head()
viz=cdf[['company', 'job', 'degree', 'salary_more_then_50000']]
viz.hist(plt.show())
Output:
(3)
solving(3)
Signature