Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
31 views
9 pages
DSML
Uploaded by
Madhu Sai
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save dsml For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
31 views
9 pages
DSML
Uploaded by
Madhu Sai
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save dsml For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 9
Search
Fullscreen
import pandas as pd df=pd.read_csv("auction1.csv") display (df) PLAYER S1.No. AYER age Abdulla, 0 1 lle Abdur | Razak? Badrinath 2 3 Ke 3 4 Bailey.) 2 4 5 Dhoni,MS 2 Gambhir, 5 6 in 2 Ganguly, 6 7 yg 7 8 Kohi,V 1 Next steps: Generate code with d¥ Double-click (or enter) to edit Qi country Team PLAYING CAPTAINCY ROLE EXP SA KXIP_ Allrounder 0 BAN RCB Bowler 0 IND CSK Batsman 0 AUS CSK Batsman 1 IND CSK W. Keeper 1 IND DD+ —Batsman 1 IND KKR+ Batsman 1 IND RCB Batsman 1 © View recommended plots AVE SIXERS 0.00 0 0.00 0 32.93 28 21.00 o 37.13 64 33.31 32 25.45 42 28.26 49 AUCTION YEAR 2009 2008 2011 2009 2008 2008 2011 2011import pandas as pd import matplotlib.pyplot as plt import seaborn as sn box=plt.boxplot(df ['SOLD PRICE']) iten.get_ydata()[0] for item in box{'caps*]] item.get_ydata()[@] for item in box[ "whiskers" ]] co[item.get_ydata()[@] for item in box[ "medians" ]] print(“Lower quartile: *,b[@]) print("Upper quartile: *,b[1]) print(*Median: ",c[@]) print("\nHighest value: ",a[1]) print (“Lowest valu ale]) print([item.get_ydata()[@] for item in box[ ‘whiskers’ ]]) print("Inter-Quartile Range:", b[1]-b[@]) print("\noutliers:") print(df{df["SOLD PRICE"]>b[1]] [["PLAYER NAME", "SOLD PRICE"]].sort_values('SOLD PRICE"))Q2 Lower quartile: 181250.@ Upper quartile: 1575000.0 Median: 675000.0 Highest value: 1800000 Lowest value: 50000 [18125¢.@, 1575000.6] Inter-Quartile Range: 1393750.0 outliers: PLAYER NAME SOLD PRICE 7 Kohli, V 1800000 1@ Tendulkar, SR 1800000 11 Yuvraj Singh 180000 1e6 175 1.50 1.25 1.00 O75 0.50 0.25 0.00import pandas as pd import matplotlib.pyplot as plt import seaborn as sn fig, ax = plt.subplots() batsman_df = df[df ["PLAYING ROLE”] ax.scatter (x = batsman_df.SIXERS, y “Batsman"] batsman_df["SOLD PRICE"],label = "Batsman") Allrounder_df = df [df ["PLAYING ROLE"] == “Allrounder”] ax.scatter (x = Allrounder_df.SIXERS, y = Allrounder_df["SOLD PRICE"], label = “All Rounder” legendi = ax. legend(*ax.get_legend_handles_labels(), loc="upper left", title="Ranking") ax. set_xlabel ("Sixers") ax.set_ylabel("Sold Price") plt.show() influential_features = ["AVE", "SIXERS", "SOLD PRICE"] sn.pairplot(df[influential_features], height = 2) plt.show() df[influential_features] .corr() plt.show() sn.heatmap(df[influential_features].corr(), annot=True) plt.show()106 Ranking @ Batsman @ All Rounder 175 1.50 9 q zg 8 8k 20Ud PIOS 3 4 0.25 0.00 60 20 10 Sixers suaxis 30Iud a10sAVE SIXERS SOLD PRICE 16 1.00 AVE 0.95 0.90 0.85 SIXERS 0.80 0.75 SOLD PRICE SOLD PRICE Q3 from scipy.optimize import root from math import cos from math import sin import math import scipy def eqn(x) return x*sin(x) + cos(x) xO=int(input("Enter the region where you want your nearest root: ")) myroot = scipy.optimize.root (eqn, x@) print (myroot.x[@]) Enter the region where you want your nearest root: @ 2.798386045783887
:7: DeprecationWarning: Conversion of an array with ndim return x*sin(x) + cos(x) Q4from scipy.optimize import minimize def eqn(x) return x*#2 + 3*x + 16 y = minimize(eqn, ®, method="BFGS' ) print(y) message: Optimization terminated successfully. success: True status: @ fun: 7.75 [-1. 5200400] nit: 2 jac: [ 2.2000+00] hess_inv: [[ 5.00@e-01]] nfev: 6 njev: 3 Qs fron sklearn.datasets inport load_iris iris = load_inis() X = iris.data y = inis.target from sklearn.model_selection import train_test_split X_train, Xtest, y_train, y_test = train_test_split(X, y, test_size=0.4, random_state=1) from sklearn.neighbors inport KNeighborsClassifier kin = KNeighborsClassifier(n_neighbors=3) knn.fit(X_train, y_train) y_pred = knn.predict(x test) from sklearn import metrics print("kNN model accuracy: » metrics.accuracy_score(y_test, y_pred)) sample = [[3, 5, 4, 2], [2, 3, 5, 4]] preds = knn.predict (sample) pred_species = [iris.target_names[p] for p in preds] print("Predictions:", pred_species) kNN model accuracy: @.9833333333333333 Predictions: ['versicolor’, ‘virginica'] a6import numpy as np vi =np.array([2,4]) v2=np.array([3,9]) print ("Vector addition: ", vi+v2) print ("Vector subtraction: ", vi-v2) print ("Vector scalar multiplication (S*v1): ", 5*v1) print ("Vector scalar multiplication (Sti): ", 5*v2) print ("Vector DOT product (vi.v2): ", vi-dot(v2)) print ("Vector length (v1 length): ", np.linalg.norm(v1)) print ("Angle between Vectors: ",np.arccos(v1.dot(v2)/(np.1inalg. norm(v1)*np. Linalg.norm(v2 vector Vector vector Vector vector Vector addition: [ 5 13] subtraction: [-1 -5] scalar multiplication (S*v1): [10 20] scalar multiplication (S*v1): [15 45] DOT product (v1.v2): 42 Length (v1 length): 4.47213595499958 Angle between Vectors: @.14189705460416438 Q7 import numpy as np A= np.array([[1 ,2 ,1], [4,4 ,5], (6,7, 7]]) B= np.array([[-7, -7, 6], [2 51-1], [4 5, -4]]) ab=np.matmul (A,B) baenp.matmul (B,A) print(ab) print(ba) result_variable = (ab == ba).all() if(result_variable Yes, AB=BA ") print else: True): print(" No ") [[1 0 @] [o1@][9 0 4]] [[1 ee] [810] [2 01]] Yes, AB=BA
You might also like
Advanced ML PDF
PDF
No ratings yet
Advanced ML PDF
25 pages
Ee23b039 Assingment
PDF
No ratings yet
Ee23b039 Assingment
9 pages
Data Wrangling Python.
PDF
No ratings yet
Data Wrangling Python.
8 pages
One Hot Encoding
PDF
No ratings yet
One Hot Encoding
12 pages
Project 4 - House Price Prediction - Ipynb - Colab
PDF
No ratings yet
Project 4 - House Price Prediction - Ipynb - Colab
5 pages
ML Short Code - Under Updating
PDF
No ratings yet
ML Short Code - Under Updating
4 pages
ML Shristi File
PDF
No ratings yet
ML Shristi File
49 pages
ML Yogesh
PDF
No ratings yet
ML Yogesh
23 pages
SVM (Support Vector Machine) For Classification - by Aditya Kumar - Towards Data Science
PDF
100% (1)
SVM (Support Vector Machine) For Classification - by Aditya Kumar - Towards Data Science
28 pages
Machine Learning Lab (17CSL76)
PDF
No ratings yet
Machine Learning Lab (17CSL76)
48 pages
Data Frames and Charts: 2.1 Working With Dataframes
PDF
No ratings yet
Data Frames and Charts: 2.1 Working With Dataframes
13 pages
Exercise5 Solution
PDF
No ratings yet
Exercise5 Solution
22 pages
Importing Libraries: Pandas PD Matplotlib - Pyplot PLT Numpy NP
PDF
No ratings yet
Importing Libraries: Pandas PD Matplotlib - Pyplot PLT Numpy NP
10 pages
Train
PDF
No ratings yet
Train
17 pages
Lab Manual ML
PDF
No ratings yet
Lab Manual ML
23 pages
CB0494 Notes
PDF
No ratings yet
CB0494 Notes
6 pages
Data Science Record - 05
PDF
No ratings yet
Data Science Record - 05
20 pages
Mlext
PDF
No ratings yet
Mlext
1 page
Udacity Machine Learning Analysis Supervised Learning
PDF
100% (1)
Udacity Machine Learning Analysis Supervised Learning
504 pages
KNN - Predictive Analysis
PDF
No ratings yet
KNN - Predictive Analysis
6 pages
Lab Extern L
PDF
No ratings yet
Lab Extern L
8 pages
ML Final-1
PDF
No ratings yet
ML Final-1
7 pages
Machine Learning Lab Manual
PDF
No ratings yet
Machine Learning Lab Manual
26 pages
ML Lab Manual
PDF
No ratings yet
ML Lab Manual
70 pages
ML Lab Manual
PDF
No ratings yet
ML Lab Manual
24 pages
Remaining ML Program
PDF
No ratings yet
Remaining ML Program
12 pages
Final ML File
PDF
No ratings yet
Final ML File
34 pages
Comprehensive Data Exploration With Python
PDF
No ratings yet
Comprehensive Data Exploration With Python
20 pages
AIML
PDF
No ratings yet
AIML
12 pages
Python For DS Cheat Sheet
PDF
100% (2)
Python For DS Cheat Sheet
6 pages
ML Manual
PDF
No ratings yet
ML Manual
9 pages
Machine Learning Lab
PDF
No ratings yet
Machine Learning Lab
20 pages
ML Experiments
PDF
No ratings yet
ML Experiments
22 pages
Untitled Document
PDF
No ratings yet
Untitled Document
19 pages
Machine Learning Record VR19
PDF
No ratings yet
Machine Learning Record VR19
46 pages
Import As Import As From Import: "Mean Squared Errors: "
PDF
No ratings yet
Import As Import As From Import: "Mean Squared Errors: "
1 page
MLLab Manual
PDF
No ratings yet
MLLab Manual
24 pages
BDS-Homework-1-Submission - Ipynb - Colab
PDF
No ratings yet
BDS-Homework-1-Submission - Ipynb - Colab
11 pages
ML Manual
PDF
No ratings yet
ML Manual
30 pages
ML0101EN Clas K Nearest Neighbors CustCat Py v1
PDF
100% (1)
ML0101EN Clas K Nearest Neighbors CustCat Py v1
11 pages
Pca2 1
PDF
No ratings yet
Pca2 1
26 pages
ML Functions
PDF
No ratings yet
ML Functions
12 pages
Datascience PR 6 Veda
PDF
No ratings yet
Datascience PR 6 Veda
6 pages
Machine Learning Lab Manual
PDF
No ratings yet
Machine Learning Lab Manual
9 pages
MLWP LAB Experiment's
PDF
No ratings yet
MLWP LAB Experiment's
11 pages
ML0101EN Clas SVM Cancer Py v1
PDF
No ratings yet
ML0101EN Clas SVM Cancer Py v1
10 pages
M PDF
PDF
No ratings yet
M PDF
13 pages
ML Keshav
PDF
No ratings yet
ML Keshav
23 pages
QUIZ Week 2 CART Practice PDF
PDF
No ratings yet
QUIZ Week 2 CART Practice PDF
10 pages
DSBDA Prac4 2
PDF
No ratings yet
DSBDA Prac4 2
1 page
Mlalllabprgs
PDF
No ratings yet
Mlalllabprgs
17 pages
Praveen Ai
PDF
No ratings yet
Praveen Ai
6 pages
Da Program
PDF
No ratings yet
Da Program
18 pages
Machine Learning Laboratory Manual
PDF
No ratings yet
Machine Learning Laboratory Manual
11 pages
KRAI LabManual
PDF
No ratings yet
KRAI LabManual
77 pages
ML Journal External
PDF
No ratings yet
ML Journal External
14 pages
Reading Data: #Importing Required Libraries
PDF
No ratings yet
Reading Data: #Importing Required Libraries
16 pages
AAL Programs
PDF
No ratings yet
AAL Programs
12 pages
ML Lab Record
PDF
No ratings yet
ML Lab Record
33 pages