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)
35 views
Mlext
Uploaded by
21491a05w8
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, TXT or read online on Scribd
Download now
Download
Save mlext For Later
Download
Save
Save mlext For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
35 views
Mlext
Uploaded by
21491a05w8
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, TXT or read online on Scribd
Download now
Download
Save mlext For Later
Carousel Previous
Carousel Next
Save
Save mlext For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 1
Search
Fullscreen
EXP(3): EXP(6): EXP(9) logistic):
#Statistics Module: import numpy as np import numpy as np
import statistics as st import pandas as pd import matplotlib.pyplot as plt
data = [5, 4, 1, 3, 2, 4, 5, 4, 5, 6] import seaborn as sns import pandas as pd
print('Mean: ', st.mean(data)) import os import seaborn as sns
print('Median: ', st.median(data)) for dirname, _, filenames in from sklearn.model_selection import
print('Mode: ', st.mode(data)) os.walk('kaggle/input'): train_test_split
print('Variance: ', round(st.variance(data),2)) for filename in filenames: from sklearn.preprocessing import
print('Standard Deviation: ', print(os.path.join(dirname, filename)) StandardScaler
round(st.stdev(data),2)) import matplotlib.pyplot as plt from sklearn.linear_model import
#Math module: %matplotlib inline LogisticRegression
import math df = pd.read_csv('/content/minihomeprices.csv') from sklearn.metrics import confusion_matrix,
print("Exponential value: ", math.e) df.head() accuracy_score
print("Pi value: ",math.pi) df.info() dataset =
print("Infinite value: ", math.inf) df.describe().style.background_gradient(cmap=' pd.read_csv('/content/Social_Network_Ads.csv')
print("Not a number value: ", math.nan) CMRmap') print(dataset.columns)
print("Logarithmic: ", math.log(math.e)) df.isna().sum() X = dataset[['Age', 'EstimatedSalary']]
print("factorial of 5 is", math.factorial(5)) df['bedrooms'] = df['bedrooms'].fillna( y = dataset['Purchased']
print("GCD of 64 and 42 is", math.gcd(64,42)) df['bedrooms'].mean() ) X_train,X_test,y_train,y_test =
print("Floor of 5.67 is", math.floor(5.67)) df.head() train_test_split(X,y,test_size=0.25)
print("Ceil of 5.67 is", math.ceil(5.67)) plt.figure(figsize=(10, 7)) #feature scaling
#Numpy module plt.title("Bedroom wise price increase") sc = StandardScaler()
import numpy as np plt.xlabel("Bedrooms" ) X_train = sc.fit_transform(X_train)
#Creating arrays plt.ylabel('Price') X_test = sc.transform(X_test)
ar1d = np.arange(11,17) plt.show() classifier = LogisticRegression()
ar2d = np.arange(11,36).reshape(5,5) plt.figure(figsize=(10, 5)) classifier.fit(X_train, y_train)
print("1-D array is:") plt.title("Price vs Bedroom Scatter plot") y_pred = classifier.predict(X_test)
print(ar1d) plt.xlabel("House Bedrooms") print("Confusion Matrix")
print("2-D array is:") plt.ylabel("House Price") print(confusion_matrix(y_test, y_pred))
print(ar2d) plt.show() print("Accuracy Score",accuracy_score(y_test,
#Properties plt.figure(figsize=(10, 7)) y_pred))
print("ar1d shape, size, dimensions are", sns.lmplot(x='bedrooms', y='price', data=df); sns.regplot(x=X_test[:,:-1], y=y_test,
ar1d.shape, ar1d.size,ar1d.ndim) plt.title("Price and bedroom wise line plot") logistic=True)
print("ar2d shape, size, dimensions are", plt.show() sns.regplot(x=X_test[:,:-1], y=y_pred,
ar2d.shape, ar2d.size,ar2d.ndim) from sklearn.linear_model import logistic=True)
#indexing LinearRegression OUTPUT:
print("Indexing on ar1d:", ar1d[2],ar1d[-2]) mdl = LinearRegression() Index(['Age', 'EstimatedSalary', 'Purchased'],
print("Indexing on ar2d:", ar2d[2][1],ar2d[1][1]) X = df.drop(['price'], axis=1) dtype='object')
#slicing y = df['price'] Confusion Matrix
print("Slicing on ar1d:", ar1d[2:6]) df['bedrooms'] = df['bedrooms'].astype('int64') [[63 2]
print("Slicing on ar2d:") df.info() [11 24]]
print(ar2d[1:4,2:4]) print(X) Accuracy Score 0.87
#scipy Module print('-' * 25)
from scipy import constants print(y)
print(constants.pi) mdl.fit(X, y)
print(constants.giga) OUTPUT:
print(constants.mega) <class 'pandas.core.frame.DataFrame'>
print(constants.kilo) RangeIndex: 6 entries, 0 to 5
print(constants.gram) Data columns (total 4 columns):
print(constants.pound) # Column Non-Null Count Dtype
OUTPUT: --- ------ -------------- -----
Mean: 3.9 0 area 6 non-null int64
Median: 4.0 1 bedrooms 6 non-null int64
Mode: 5 2 age 6 non-null int64
Variance: 2.32 3 price 6 non-null int64
Standard Deviation: 1.52 dtypes: int64(4)
Exponential value: 2.718281828459045 memory usage: 320.0 bytes
Pi value: 3.141592653589793 area bedrooms age
Infinite value: inf 0 2600 3.0 20
Not a number value: nan 1 3000 4.0 15
Logarithmic: 1.0 2 3200 4.2 18
factorial of 5 is 120 3 3600 3.0 30
GCD of 64 and 42 is 2 4 4000 5.0 8
Floor of 5.67 is 5 5 4100 6.0 8
Ceil of 5.67 is 6 -------------------------
1-D array is: 0 550000
[11 12 13 14 15 16] 1 565000
2-D array is: 2 610000
[[11 12 13 14 15] 3 595000
[16 17 18 19 20] 4 760000
[21 22 23 24 25] 5 810000
[26 27 28 29 30] Name: price, dtype: int64
[31 32 33 34 35]]
ar1d shape, size, dimensions are (6,) 6 1
ar2d shape, size, dimensions are (5, 5) 25 2
Indexing on ar1d: 13 15
Indexing on ar2d: 22 17
Slicing on ar1d: [13 14 15 16]
Slicing on ar2d:
[[18 19]
[23 24]
[28 29]]
3.141592653589793
1000000000.0
1000000.0
1000.0
0.001
0.45359236999999997
You might also like
Laravel Testing Decoded
PDF
No ratings yet
Laravel Testing Decoded
279 pages
Copy of Project 4 _ House Price Prediction.ipynb - Colab
PDF
No ratings yet
Copy of Project 4 _ House Price Prediction.ipynb - Colab
5 pages
Regression Algorithm
PDF
No ratings yet
Regression Algorithm
9 pages
MachineLearning
PDF
No ratings yet
MachineLearning
10 pages
Mlda - Lab
PDF
No ratings yet
Mlda - Lab
35 pages
PythonFile[1]
PDF
No ratings yet
PythonFile[1]
5 pages
One Hot Encoding
PDF
No ratings yet
One Hot Encoding
12 pages
Code 1
PDF
No ratings yet
Code 1
3 pages
Pattern - Recognition - 3 - Code With Output
PDF
No ratings yet
Pattern - Recognition - 3 - Code With Output
7 pages
ML Shristi File
PDF
No ratings yet
ML Shristi File
49 pages
Final ML File
PDF
No ratings yet
Final ML File
34 pages
Data Science Record_05
PDF
No ratings yet
Data Science Record_05
20 pages
Document From Jahnavi
PDF
No ratings yet
Document From Jahnavi
20 pages
ML Lab Prgms Split
PDF
No ratings yet
ML Lab Prgms Split
3 pages
MLLabManual
PDF
No ratings yet
MLLabManual
24 pages
Project Linear Regression
PDF
No ratings yet
Project Linear Regression
7 pages
f3683849-7ca6-4854-8f96-af11b6e837ec
PDF
No ratings yet
f3683849-7ca6-4854-8f96-af11b6e837ec
20 pages
Deepak Data Analysis 1
PDF
No ratings yet
Deepak Data Analysis 1
31 pages
Docu 4
PDF
No ratings yet
Docu 4
3 pages
ml labs
PDF
No ratings yet
ml labs
14 pages
Aayushi ML File
PDF
No ratings yet
Aayushi ML File
37 pages
Prac - 8 (1) - Jupyter Notebook
PDF
No ratings yet
Prac - 8 (1) - Jupyter Notebook
6 pages
Presentation 1
PDF
No ratings yet
Presentation 1
2 pages
House Price Prediction Using Machine Learning in Python
PDF
No ratings yet
House Price Prediction Using Machine Learning in Python
13 pages
Machine Learning
PDF
No ratings yet
Machine Learning
22 pages
lab ML
PDF
No ratings yet
lab ML
26 pages
Assignmnet 5
PDF
No ratings yet
Assignmnet 5
11 pages
Zerox Ready
PDF
No ratings yet
Zerox Ready
21 pages
KRAI LabManual
PDF
No ratings yet
KRAI LabManual
77 pages
Train
PDF
No ratings yet
Train
17 pages
Karmbir 19 ML
PDF
No ratings yet
Karmbir 19 ML
20 pages
houses prices prediction model
PDF
No ratings yet
houses prices prediction model
11 pages
Know Your Dataset: Season Holiday Weekday Workingday CNT 726 727 728 729 730
PDF
No ratings yet
Know Your Dataset: Season Holiday Weekday Workingday CNT 726 727 728 729 730
1 page
ml
PDF
No ratings yet
ml
17 pages
ml record
PDF
No ratings yet
ml record
21 pages
16BCB0126 VL2018195002535 Pe003
PDF
No ratings yet
16BCB0126 VL2018195002535 Pe003
40 pages
Chandigarh Group of Colleges College of Engineering Landran, Mohali
PDF
No ratings yet
Chandigarh Group of Colleges College of Engineering Landran, Mohali
47 pages
External
PDF
No ratings yet
External
11 pages
Ash Regression
PDF
No ratings yet
Ash Regression
11 pages
mll
PDF
No ratings yet
mll
5 pages
ml lab
PDF
No ratings yet
ml lab
23 pages
DOC-20241108-WA0003
PDF
No ratings yet
DOC-20241108-WA0003
16 pages
Vertopal.com Lab4 KNN
PDF
No ratings yet
Vertopal.com Lab4 KNN
9 pages
Exercise5 Solution
PDF
No ratings yet
Exercise5 Solution
22 pages
Roll NO 2020
PDF
No ratings yet
Roll NO 2020
8 pages
ML Lab Manual
PDF
No ratings yet
ML Lab Manual
24 pages
Time Series Analysis Group 9
PDF
No ratings yet
Time Series Analysis Group 9
16 pages
Da Program
PDF
No ratings yet
Da Program
18 pages
Machine Learning Program
PDF
No ratings yet
Machine Learning Program
12 pages
EE2211 CheatSheet
PDF
No ratings yet
EE2211 CheatSheet
15 pages
5 - One - Hot - Encoding - Ipynb - Colaboratory
PDF
No ratings yet
5 - One - Hot - Encoding - Ipynb - Colaboratory
8 pages
Ilovepdf Merged
PDF
No ratings yet
Ilovepdf Merged
47 pages
ML File
PDF
No ratings yet
ML File
37 pages
som
PDF
No ratings yet
som
19 pages
Introduction To Machine Learning (ML) With Sklearn
PDF
No ratings yet
Introduction To Machine Learning (ML) With Sklearn
10 pages
Reading Data: #Importing Required Libraries
PDF
No ratings yet
Reading Data: #Importing Required Libraries
16 pages
03 Multiple Linear Regression
PDF
No ratings yet
03 Multiple Linear Regression
7 pages
Chirag HOusing Price Pred
PDF
No ratings yet
Chirag HOusing Price Pred
12 pages
D3 docs
PDF
No ratings yet
D3 docs
6 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
Gd Script
From Everand
Gd Script
Marijo Trkulja
No ratings yet
Error Handling in ASP
PDF
No ratings yet
Error Handling in ASP
116 pages
C Prog_Lab assignment 1 Writeup updated
PDF
No ratings yet
C Prog_Lab assignment 1 Writeup updated
5 pages
Introcss PPT 01 02 PDF
PDF
No ratings yet
Introcss PPT 01 02 PDF
14 pages
Practical No:3: 1) Implementation of Stacks Using Linked List A) Write A Program To Implement Stack Using Array. Program
PDF
No ratings yet
Practical No:3: 1) Implementation of Stacks Using Linked List A) Write A Program To Implement Stack Using Array. Program
17 pages
Assertion Based Question
PDF
50% (2)
Assertion Based Question
9 pages
R for Data Science Import Tidy Transform Visualize and Model Data 1st Edition by Hadley Wickham, Garrett Grolemund 1491910399 978-1491910399 pdf download
PDF
100% (2)
R for Data Science Import Tidy Transform Visualize and Model Data 1st Edition by Hadley Wickham, Garrett Grolemund 1491910399 978-1491910399 pdf download
48 pages
Python Manual
PDF
No ratings yet
Python Manual
22 pages
Prepare For SAP BTP Development
PDF
No ratings yet
Prepare For SAP BTP Development
13 pages
BABTWR
PDF
No ratings yet
BABTWR
2 pages
PPL Unit 3
PDF
No ratings yet
PPL Unit 3
24 pages
Question Bank's
PDF
No ratings yet
Question Bank's
89 pages
NodeJS ReactJS Django-1
PDF
No ratings yet
NodeJS ReactJS Django-1
57 pages
Pro PHP and jQuery 1st Edition Jason Lengstorf 2024 scribd download
PDF
100% (15)
Pro PHP and jQuery 1st Edition Jason Lengstorf 2024 scribd download
60 pages
E1102000242GB04
PDF
No ratings yet
E1102000242GB04
156 pages
Lua Programming The Ultimate Beginner s Guide to Learn Lua Step by Step Claudia Alves & Alexander Aronowitz [Alves instant download
PDF
100% (2)
Lua Programming The Ultimate Beginner s Guide to Learn Lua Step by Step Claudia Alves & Alexander Aronowitz [Alves instant download
42 pages
Embedded Programmer - STM32F4DISCOVERY Development With GCC in Eclipse
PDF
No ratings yet
Embedded Programmer - STM32F4DISCOVERY Development With GCC in Eclipse
23 pages
Chapter 7 Expressions and Assignment Statements
PDF
No ratings yet
Chapter 7 Expressions and Assignment Statements
11 pages
Minesweeperr
PDF
No ratings yet
Minesweeperr
10 pages
04 Activity 1 - PLATTECH
PDF
No ratings yet
04 Activity 1 - PLATTECH
2 pages
Android Application Programming
PDF
No ratings yet
Android Application Programming
7 pages
Structures of Programming Languages
PDF
No ratings yet
Structures of Programming Languages
18 pages
PRINCIPLES OF DATA SCIENCE by - JOHN P DICKERSON
PDF
No ratings yet
PRINCIPLES OF DATA SCIENCE by - JOHN P DICKERSON
91 pages
Nested Queries
PDF
No ratings yet
Nested Queries
29 pages
Unit 1 Python
PDF
No ratings yet
Unit 1 Python
52 pages
Transformers: State-of-the-Art Natural Language Processing
PDF
No ratings yet
Transformers: State-of-the-Art Natural Language Processing
8 pages
1-What Is Asyntax Error?: Basics
PDF
No ratings yet
1-What Is Asyntax Error?: Basics
8 pages
Rajesh_Kumar_Resume
PDF
No ratings yet
Rajesh_Kumar_Resume
3 pages
Connect To Database in Java
PDF
No ratings yet
Connect To Database in Java
8 pages
VLSI Design Methodology: Topics
PDF
No ratings yet
VLSI Design Methodology: Topics
12 pages