Skip to content

Commit 7f5e109

Browse files
committedApr 23, 2021
HW3
1 parent 9510fdf commit 7f5e109

File tree

1 file changed

+203
-0
lines changed

1 file changed

+203
-0
lines changed
 

‎Homeworks/ML_Homework3.ipynb

+203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"id": "LeSxH2p71hE_"
7+
},
8+
"source": [
9+
"## Homework 3\n",
10+
"\n",
11+
"* sklearn.datasets sınıfında \"make_classification\" fonksiyonunu kullanarak veri kümesi oluşturun. Tek etiket (y) 9 özellik (X) ile 10000 örnek oluşturun. Ayrıca şu parametreleri kullanın: \n",
12+
" * `n_informative` = 4\n",
13+
" * `class_sep` = 2\n",
14+
" * `random_state` = 18\n",
15+
"* Ham veriyi inceleyin ve analiz edin.\n",
16+
"* Sınıflandırma (classification) için ön işlem yapın.\n",
17+
"* Veri kümenizi eğitim ve test alt kümlerine ayırın (eğitim için 0.7 ve test için 0.3 oran olacak şekilde).\n",
18+
"* Karar Ağacı ve XGBoost Algoritmasını farklı hiperparametrelerle deneyin. (GridSearchCV kullanabilirisiniz.)\n",
19+
"* Sonucunuzu hem eğitim hem de test setinde değerlendirin. Herhangi bir yetersiz uyum (underfitting) veya aşırı uyum (overfitting) sorunu olup olmadığını analiz edin ve yorumlayın."
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": null,
25+
"metadata": {
26+
"id": "e4vcrjaL1hFK"
27+
},
28+
"outputs": [],
29+
"source": [
30+
"# Gerekli kitaplıkları içe aktarın."
31+
]
32+
},
33+
{
34+
"cell_type": "code",
35+
"execution_count": null,
36+
"metadata": {
37+
"id": "CC3DSbYZ1hFL"
38+
},
39+
"outputs": [],
40+
"source": [
41+
"# Sklearn'de make_classification fonksiyonunu kullanarak veri kümesi oluşturun.\n",
42+
"# Pandas veri çerçevesine dönüştürün."
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": null,
48+
"metadata": {
49+
"id": "33bwR0FZ1hFL"
50+
},
51+
"outputs": [],
52+
"source": [
53+
"# Yinelenen satırları ve eksik verileri kontrol edin."
54+
]
55+
},
56+
{
57+
"cell_type": "code",
58+
"execution_count": null,
59+
"metadata": {
60+
"id": "i7pgkDqx1hFM"
61+
},
62+
"outputs": [],
63+
"source": [
64+
"# Her özellik için verileri görselleştirin (pairplot, distplot etc.)."
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": null,
70+
"metadata": {
71+
"id": "IZnN7ISP1hFM"
72+
},
73+
"outputs": [],
74+
"source": [
75+
"# Korelasyon matrisi çizin."
76+
]
77+
},
78+
{
79+
"cell_type": "code",
80+
"execution_count": null,
81+
"metadata": {
82+
"id": "jirBAqpP1hFM"
83+
},
84+
"outputs": [],
85+
"source": [
86+
"# Aykırı değerleri işleyin (IsolationForest, Z-score, IQR kullanabilirsiniz)"
87+
]
88+
},
89+
{
90+
"cell_type": "code",
91+
"execution_count": null,
92+
"metadata": {
93+
"id": "OWxHleiK1hFM"
94+
},
95+
"outputs": [],
96+
"source": [
97+
"# Veri kümesini eğitim ve test verisetlerine ayırın."
98+
]
99+
},
100+
{
101+
"cell_type": "code",
102+
"execution_count": null,
103+
"metadata": {
104+
"id": "phwFv2mX1hFN"
105+
},
106+
"outputs": [],
107+
"source": [
108+
"# Karar Ağacını içe aktarın, farklı hiperparametreleri deneyerek algoritmayı ayarlayın. (hyperpara)"
109+
]
110+
},
111+
{
112+
"cell_type": "code",
113+
"execution_count": null,
114+
"metadata": {
115+
"id": "XMoW2J-s1hFN"
116+
},
117+
"outputs": [],
118+
"source": [
119+
"# Öznitelik önemlerini (feature importances) görselleştirin."
120+
]
121+
},
122+
{
123+
"cell_type": "code",
124+
"execution_count": null,
125+
"metadata": {
126+
"id": "1ml8mv431hFN"
127+
},
128+
"outputs": [],
129+
"source": [
130+
"# Hata matrisini oluşturun ve accuracy, recall, precision ve f1-score değerlerini hesaplayın."
131+
]
132+
},
133+
{
134+
"cell_type": "code",
135+
"execution_count": null,
136+
"metadata": {
137+
"id": "uPoKe_641hFN"
138+
},
139+
"outputs": [],
140+
"source": [
141+
"# XGBoostClassifier'ı içe aktarın, farklı hiperparametreleri deneyerek algoritmayı ayarlayın."
142+
]
143+
},
144+
{
145+
"cell_type": "code",
146+
"execution_count": null,
147+
"metadata": {
148+
"id": "Jn89xQic1hFO"
149+
},
150+
"outputs": [],
151+
"source": [
152+
"# Öznitelik önemlerini (feature importances) görselleştirin."
153+
]
154+
},
155+
{
156+
"cell_type": "code",
157+
"execution_count": null,
158+
"metadata": {
159+
"id": "3aqlPtJP1hFO"
160+
},
161+
"outputs": [],
162+
"source": [
163+
"# Hata matrisini oluşturun ve accuracy, recall, precision ve f1-score değerlerini hesaplayın."
164+
]
165+
},
166+
{
167+
"cell_type": "code",
168+
"execution_count": null,
169+
"metadata": {
170+
"id": "sKq6RZL51hFO"
171+
},
172+
"outputs": [],
173+
"source": [
174+
"# Sonucunuzu değerlendirin ve veri setimiz için en iyi performans gösteren algoritmayı seçin."
175+
]
176+
}
177+
],
178+
"metadata": {
179+
"colab": {
180+
"name": "ML_Homework3.ipynb",
181+
"provenance": []
182+
},
183+
"kernelspec": {
184+
"display_name": "Python 3",
185+
"language": "python",
186+
"name": "python3"
187+
},
188+
"language_info": {
189+
"codemirror_mode": {
190+
"name": "ipython",
191+
"version": 3
192+
},
193+
"file_extension": ".py",
194+
"mimetype": "text/x-python",
195+
"name": "python",
196+
"nbconvert_exporter": "python",
197+
"pygments_lexer": "ipython3",
198+
"version": "3.7.3"
199+
}
200+
},
201+
"nbformat": 4,
202+
"nbformat_minor": 4
203+
}

0 commit comments

Comments
 (0)
Please sign in to comment.