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)
64 views
1 page
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
Save
Save mlext For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
64 views
1 page
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
Carousel Previous
Carousel Next
Download
Save
Save mlext For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save mlext For Later
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
Sic - Et - Non by Peter Abelard
PDF
100% (2)
Sic - Et - Non by Peter Abelard
475 pages
The Customer Journey of The Premium Traveler PDF
PDF
No ratings yet
The Customer Journey of The Premium Traveler PDF
38 pages
Swivel Grease MSDS
PDF
No ratings yet
Swivel Grease MSDS
8 pages
Project 4 - House Price Prediction - Ipynb - Colab
PDF
No ratings yet
Project 4 - House Price Prediction - Ipynb - Colab
5 pages
Regression Algorithm
PDF
No ratings yet
Regression Algorithm
9 pages
Machine Learning
PDF
No ratings yet
Machine Learning
10 pages
Mlda - Lab
PDF
No ratings yet
Mlda - Lab
35 pages
Python File
PDF
No ratings yet
Python File
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
Machine Learning Lab
PDF
No ratings yet
Machine Learning Lab
20 pages
Final ML File
PDF
No ratings yet
Final ML File
34 pages
ML Manual
PDF
No ratings yet
ML Manual
9 pages
ML 1-11
PDF
No ratings yet
ML 1-11
27 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
ML Lab Record
PDF
No ratings yet
ML Lab Record
17 pages
ML Record
PDF
No ratings yet
ML Record
19 pages
ML Manual
PDF
No ratings yet
ML Manual
30 pages
MLLab Manual
PDF
No ratings yet
MLLab Manual
24 pages
Project Linear Regression
PDF
No ratings yet
Project Linear Regression
7 pages
Machine Learning Project: TITLE: Predicting The Sale Price of A House Using Linear Regression
PDF
No ratings yet
Machine Learning Project: TITLE: Predicting The Sale Price of A House Using Linear Regression
20 pages
DSBDA Prac4 2
PDF
No ratings yet
DSBDA Prac4 2
1 page
Machine Learning Lab Manual
PDF
No ratings yet
Machine Learning Lab Manual
9 pages
ML Yogesh
PDF
No ratings yet
ML Yogesh
23 pages
Datascience PR 6 Veda
PDF
No ratings yet
Datascience PR 6 Veda
6 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
Mlalllabprgs
PDF
No ratings yet
Mlalllabprgs
17 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
Machine Learning Programs
PDF
No ratings yet
Machine Learning Programs
10 pages
ML Programs
PDF
No ratings yet
ML Programs
14 pages
ML Four To Eight
PDF
No ratings yet
ML Four To Eight
3 pages
Data Preprocessing 2
PDF
No ratings yet
Data Preprocessing 2
5 pages
Housing Prices Linear Regression
PDF
No ratings yet
Housing Prices Linear Regression
3 pages
Lab ML
PDF
No ratings yet
Lab ML
26 pages
Zerox Ready
PDF
No ratings yet
Zerox Ready
21 pages
Assignmnet 5
PDF
No ratings yet
Assignmnet 5
11 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
ML Short Code - Under Updating
PDF
No ratings yet
ML Short Code - Under Updating
4 pages
Machine Learning Lab Manual
PDF
No ratings yet
Machine Learning Lab Manual
18 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
S6 - Data Mining Lab Experiments (Except 1)
PDF
No ratings yet
S6 - Data Mining Lab Experiments (Except 1)
6 pages
DSBDA05
PDF
No ratings yet
DSBDA05
5 pages
Ash Regression
PDF
No ratings yet
Ash Regression
11 pages
1.load and Explore CSV and Excel Using Pandas
PDF
No ratings yet
1.load and Explore CSV and Excel Using Pandas
5 pages
ML Merged
PDF
No ratings yet
ML Merged
28 pages
Mun of La Carlota V NAWASA
PDF
No ratings yet
Mun of La Carlota V NAWASA
2 pages
HT I&ii
PDF
No ratings yet
HT I&ii
98 pages
Brand Loyalty vs. Repeat Purchasing Behavior
PDF
No ratings yet
Brand Loyalty vs. Repeat Purchasing Behavior
9 pages
Improving The ISOIEC 11770 Standard For Key Manage
PDF
No ratings yet
Improving The ISOIEC 11770 Standard For Key Manage
16 pages
CV-Diego Robles P
PDF
No ratings yet
CV-Diego Robles P
2 pages
Corporate Strategy MCQ SM
PDF
No ratings yet
Corporate Strategy MCQ SM
5 pages
HFACS 8.0 How To
PDF
No ratings yet
HFACS 8.0 How To
18 pages
TCP Ip Multimedia
PDF
No ratings yet
TCP Ip Multimedia
87 pages
Cato DLP WP
PDF
No ratings yet
Cato DLP WP
10 pages
DMW Project Report by Saurabh Zingade
PDF
No ratings yet
DMW Project Report by Saurabh Zingade
16 pages
Historiopreneurship Related Paper 3
PDF
No ratings yet
Historiopreneurship Related Paper 3
13 pages
PressRelease-2013-Recall All ICs Issued in Sabah and Issue A New Sabah IC - 03 November 2013
PDF
No ratings yet
PressRelease-2013-Recall All ICs Issued in Sabah and Issue A New Sabah IC - 03 November 2013
2 pages
A DD Merged
PDF
No ratings yet
A DD Merged
16 pages
Standards Complete
PDF
No ratings yet
Standards Complete
69 pages
Eportfolio Career Research Paper
PDF
100% (3)
Eportfolio Career Research Paper
8 pages
Multiple Injuries After Ship Tips Over at Edinburgh Dockyard
PDF
No ratings yet
Multiple Injuries After Ship Tips Over at Edinburgh Dockyard
10 pages
GROUP6
PDF
No ratings yet
GROUP6
13 pages
FD ch5 PPT Hull
PDF
No ratings yet
FD ch5 PPT Hull
37 pages
Sterling N Computing
PDF
No ratings yet
Sterling N Computing
2 pages
PDS AlphaTec MANUAL PRESSURE TEST KIT 2003
PDF
No ratings yet
PDS AlphaTec MANUAL PRESSURE TEST KIT 2003
1 page
U.S. Seismic Design Maps CHRYSLER
PDF
No ratings yet
U.S. Seismic Design Maps CHRYSLER
2 pages
Me170a - Lab 01 - Instrumentation Handout - Edited2015
PDF
No ratings yet
Me170a - Lab 01 - Instrumentation Handout - Edited2015
8 pages
Technology Newsletter
PDF
No ratings yet
Technology Newsletter
5 pages
Article Hand Signals
PDF
No ratings yet
Article Hand Signals
6 pages
Company Profile Acurate Packtech
PDF
No ratings yet
Company Profile Acurate Packtech
6 pages
Presenatation On SIP by Saral Jain
PDF
No ratings yet
Presenatation On SIP by Saral Jain
12 pages