-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLR_SIR NOTES.py
398 lines (286 loc) · 6.82 KB
/
LR_SIR NOTES.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# -*- coding: utf-8 -*-
"""
Created on Tue May 29 21:44:04 2018
@author: TEJA
"""
BITS - Machine Learning Batch 2
BITS - Machine Learning
Batch 2
STREAM
CLASSMATES
ABOUT
BITS - Machine Learning
Batch 2
Parvez Nadvi
Lokesh Payasi
UPCOMING
Woohoo, no work due soon!
VIEW ALL
TOPICS
Exam
Post by Kaluvala Dheeraj
Kaluvala Dheeraj
Created 8:19 PM8:19 PM
Sir, Can you keep the Notes to prepare for Exam Tomorrow
Announcement: "We will be having a group photo of all…"
Parvez Nadvi
Created 4:00 PM4:00 PM
We will be having a group photo of all the courses ..kindly stay back and assemble in the open air theatre.
Thank you.
Announcement: "If anyone's name isn't present in the…"
Parvez Nadvi
Created 3:29 PM3:29 PM
Exam
If anyone's name isn't present in the batch please come to PRANAV and give in your details. ASAP
Yaswanth Reddy3:43 PM
Lilith Avinash
Announcement: "Exam Batch Details. Please report to…"
Parvez Nadvi
Created 3:21 PM3:21 PM
Exam
Exam Batch Details.
Please report to the respected allocated rooms for your batch 15 mins prior.
Please go through the exam schedule and note down your batch number and timings and room number.
If there is any doubt please come and ask me immediately. Late queries will not be entertained.
HYD ML.xlsx
Excel
Anand Sangabattuni4:41 PM
Do we have to stay back after the exam or can we leave??
Announcement: "Text file for python"
Lokesh Payasi
Created 8:15 AM8:15 AM
Text file for python
metamorphosis_clean.txt
Text
Announcement: "dataset for text analytics"
Lokesh Payasi
Created 7:46 AM7:46 AM
dataset for text analytics
sms_spam.csv
Comma Separated Values
Announcement: "for todays class install tm, SnowballC,…"
Lokesh Payasi
Created 7:36 AM7:36 AM
for todays class install tm, SnowballC, wordcloud, NLP package in r
Announcement: "PPTs and Datasets-2"
Lokesh Payasi
Created May 28May 28
PPTs and Datasets-2
Decision Trees_Lok.pptx
PowerPoint
Machine Learning.pptx
PowerPoint
Support Vector Machines_Steve.pptx
PowerPoint
boosting.doc
Word
Machine learning Course Outline.docx
Word
packages.docx
Word
grad_desc.R
Binary File
knn_predict.R
Binary File
log_reg.R
Binary File
nn_mtcars.R
Binary File
rpart_bankloan.R
Binary File
bankloan coding caret and train.R
Binary File
bankloan coding caret and train(1).R
Binary File
decisiontree.R
Binary File
DecisionTree_280717.pptx
PowerPoint
student.csv
Comma Separated Values
Log_Reg1.R
Binary File
Logistic Regression.pptx
PowerPoint
Logistic Regression_Updated.pptx
PowerPoint
Announcement: "PPTs and Datasets"
Lokesh Payasi
Created May 28May 28
PPTs and Datasets
important packages for R and python.docx
Word
Linear Regression.pptx
PowerPoint
Bagging.pptx
PowerPoint
Ensemble in Python.ppt
PowerPoint
Python Basics.pptx
PowerPoint
Python Numpy.pptx
PowerPoint
SVM Python.pptx
PowerPoint
Decision Tree Python.pptx
PowerPoint
DT with Python.py
Text
Hypothesis Testing in Python.pptx
PowerPoint
KYD Python.pptx
PowerPoint
LogRegression by Python.pptx
PowerPoint
Announcement: "PPTs and Datasets"
Lokesh Payasi
Created May 28May 28
PPTs and Datasets
Assignment: "2nd Min project"
Lokesh Payasi
Created May 27May 27
DONE
2nd Min project
do it in R and python, check out project 2
Mini Projects.ppt
PowerPoint
Announcement: "list of packages for machine learning…"
Lokesh Payasi
Created May 27May 27
list of packages for machine learning in R and Python
important packages for R and python.docx
Word
Announcement: "new dataset for knn"
Lokesh Payasi
Created May 26May 26
new dataset for knn
ppt Knn.pptx
PowerPoint
wisc_bc_data.csv
Comma Separated Values
Announcement: "new dataset for knn"
Lokesh Payasi
Created May 26May 26
new dataset for knn
Announcement: "PPTs till 25th MAy"
Lokesh Payasi
Created May 26May 26
PPTs till 25th MAy
Linear Regression.pptx
PowerPoint
Python Basics.pptx
PowerPoint
Python Numpy.pptx
PowerPoint
Hypothesis Testing in Python.pptx
PowerPoint
UNIT-1.ppt
PowerPoint
UNIT-5.pptx
PowerPoint
Descriptive Statistics.pptx
PowerPoint
Announcement: "Min-Project-1"
Lokesh Payasi
Created May 26May 26
Min-Project-1
Mini Projects.ppt
PowerPoint
Announcement: "Data-set for Assignment-1(Not Project)-…"
Lokesh Payasi
Created May 25May 25
Data-set for Assignment-1(Not Project)- you can select any two file for doing your assignment. for Decision Tree Diagram you should select Assignment.
Assignment.csv
Comma Separated Values
bankloan.csv
Comma Separated Values
creditset.csv
Comma Separated Values
Announcement: "The Data-set for all the classes"
Lokesh Payasi
Created May 25May 25
The Data-set for all the classes
excelTOspss.xlsx
Excel
cs2M.xls
Excel
grades.xls
Excel
bankloan.xls
Excel
oil_temp.xls
Excel
project_kochu.xls
Excel
coal.csv
Comma Separated Values
flight_accident.csv
Comma Separated Values
gapC.csv
Comma Separated Values
Nile.csv
Comma Separated Values
Oil.csv
Comma Separated Values
pension.csv
Comma Separated Values
Project_Ann.csv
Comma Separated Values
project_kochu.csv
Comma Separated Values
Student.csv
Comma Separated Values
youth_survey.csv
Comma Separated Values
zip_code.csv
Comma Separated Values
tecator.csv
Comma Separated Values
spambase.csv
Comma Separated Values
# -*- coding: utf-8 -*-
"""
Created on Thu May 24 06:56:51 2018
@author: Lucky
"""
import sklearn.datasets as datasets
import pandas as pd
iris=datasets.load_iris()
df=pd.DataFrame(iris.data, columns=iris.feature_names)
y=iris.target
from sklearn.cross_validation import train_test_split
X_train, X_test, y_train, y_test = train_test_split(df, y,test_size = .4)
len(X_train)
len(y_test)
len(X_test)
X_test.head()
y_test.head()
# Call the decision tree
from sklearn.tree import DecisionTreeClassifier
dtree=DecisionTreeClassifier()
dtree.fit(X_train,y_train)
# Predicting the variable
treepred = dtree.predict(X_test)
treepred
treepred.sum()
y_test.sum()
# confusion Matrix
cm_deci1 = pd.crosstab(y_test, treepred, rownames=['True'],colnames=['Predicted'], margins=True)
cm_deci1
# Graph
from sklearn.externals.six import StringIO
from IPython.display import Image
from sklearn.tree import export_graphviz
import pydotplus
dot_data = StringIO()
export_graphviz(dtree, out_file=dot_data,filled=True, rounded=True,special_characters=True)
graph = pydotplus.graph_from_dot_data(dot_data.getvalue())
Image(graph.create_png())
dtree
# converting into the pdf file
with open("dtree.dot", "w") as t:
t = tree.export_graphviz(dtree, out_file=t)
dot -Tpdf dtree.dot -o dtree.pdf
open -a preview dtree.pdf
DT with Python.py
Displaying DT with Python.py.