SlideShare a Scribd company logo
1 of 20
Download to read offline
REGRESYON ANALİZİ İLEVERİ
BİLİMİ UYGULAMASI
ŞÜHEDAACAR
1121221008
Proje Danışmanı:Yrd. Doç. Dr.AYLA GÜLCÜ
İÇERİK
VERİ ÖN İŞLEME
1. Veri temizleme (Data cleaning)
Eksik verilerin doldurulması, Gürültülü
verinin düzeltilmesi
2. Veri birleştirme (Data integration)
Farklı veri dosyalarının birleştirilmesi
3. Veri dönüştürme (Data transformations)
Verinin uygun formata dönüştürülmesi,
Normalleştirme
4. Veri indirgeme (Data reduction)
Gereksiz verilerin ortadan kaldırılması
REGRESYON ANALİZİ
• Regresyon analizinde yapılan; veriden elde edilen bazı
özelliklerin girdi olarak alınması ile numerik değerlerin
tahmin edilmesidir.
• Francis Galton, 1877’ de, ilk regresyon uygulamasını, bir
bezelye tohumunun boyutunu -atalarının boyutlarını da
gözlemleyerek- hesaplamak için kullanmıştır.
Basit regresyon (Simple regression)
• Tek girdi ve çıktı üzerinden veri ile sadece basit bir model oluşturuyoruz.
Çoklu regresyon (Multiple regression) –
Birden çok özellikle lineer regresyon
• Birden çok özellik kullanılarak uygulanan lineer regresyon çeşidi çoklu
regresyondur.
• Tek girdili model iyi bir prediktif model değildir, çünkü sadece evlerin alanına
bakarak tahminde bulunmak yanıltıcı olabilir.
UYGULAMA
VERİTANIMI
• Ames Housing veri seti, Amerika Birleşik Devletleri'nin Iowa eyaletinde
yer alanAmes şehrinin konutlarının tanımlandığıAmes Assessor’s Office’
inden alınmış bir veri setidir.
• Bu veri setiAmes’ te 2006 yılından 2010 yılına kadar satılmış bireysel
konutların bilgilerini içermektedir.
• Buradan elde edilen veri seti Dean De Cock tarafından veri bilimi
eğitimde kullanılmak üzere derlenmiştir.
• https://www.kaggle.com/c/house-prices-advanced-regression-
techniques/data
Özellik tanımlamaları
Amaç
• Veri setindeki evlerin özellikleri göz önünde bulundurularak karşımıza çıkacak yeni
bir evin fiyatının ne olabileceği tahmin edilmek istenmiştir. Bunun için en uygun
lineer regresyon modeli belirlenmeye çalışılmıştır.
Kategorik ve Sayısal Özelliklerin Belirlenmesi
• İlk olarak veri özellikleri sayısallık ve kategoriklik açısından incelenmelidir.
• Gerçekte kategorik özellikler sayısal bir özellik olarak görülmüş ve bu durum
düzeltilmelidir.
• Son durumda 34 sayısal ve 47 kategorik
özellik elde edilmiştir.
Kategorik Özelliklerin Sayısal Değere Dönüştürülmesi
• Bu işlem için sklearn.preprocessing paketi kullanılmıştır. Bu sayede kategorik
değerler, ölçeklendirilmiş değerler ile belli bir sıralamaya koyularak sayısal
değerlere çevrilmiştir.
Özelliklerin Değerlendirilmesi
• Sadece satış durumunun normal olduğu durumlarda incelemesi yapılmıştır.
• Normal durumlar dışında ticaret ile satış, ipotekli malın haczi ile satış, aile üyeleri
arasında satış gibi durumların incelenmesi bu uygulamada gerekli görülmemiştir.
Özellik değerlerinin görselleştirilmesi
• Özelliklerin hangi değerlerde
yoğunlaştığının görülebilmesi için
histogramlar çizilmiş,
• Tüm özelliklerin evin fiyatları ile
ilişkisinin anlaşılabilmesi için scatter
plotlar çizilmiş ve
• Outlier’ ların belirlenebilmesi için
boxplot üzerinde veri dağılımları
gösterilmiştir.
• Train verisi  %80
• Regresyon modeli oluşturulur.
• Test verisi  %20
• Model üzerinde tahmin yapılır.
Regresyon Uygulaması
Regresyon Model Çıktıları
5-fold CrossValidation
• Veri 5 farklı bloğa bölünür. Gözlemler her blok
içerisinde rastgele atanmıştır. Algoritmanın her bir
adımı için aynı şekilde veri ayırma işlemi
gerçekleşecektir
Outlier Değerlerin Elenmesi
• Veri yığılmasının oldukça dışında
olan değerler outlier olarak
adlandırılır.
• Gürültüye yol açan bu değerler
temizlenmelidir.
• Residual değerlerinin en
yükseklerinin %20 lik kısmı
seçilerek modelden atılmıştır.
Outlier Eleme İşleminden Sonra Çıktılar
Sonuç
Tüm train verisi üzerinde regresyon
işlemi uygulanmıştır.
o MSE: 469184621.69
o R squared: 0.89
o CrossValidation:
MSE mean: 524895858.367
R squared: 0.889
 Verilerin çok fazla yoğunlaşmadığı, dışarıda kalan, veri
uç noktaları elenmiştir. Bu uç noktalar elenmiştir.
 Outlier’ ların elenmesinde sonra tekrar regresyon işlemi
uygulanmıştır.
o MSE: 134879378.86
o R squared: 0.96
o CrossValidation:
MSE mean: 136011541.317
R squared: 0.958
 Hatayı minimuma indiren, en uygun regresyon
modeline ulaşılmıştır.
KAYNAKLAR
• Fox, E. ve Guestrin,C. (2016). Machine Learning: Regression byWashington
University, https://www.coursera.org/learn/ml-regression/home/welcome
adresinden elde edilmiştir.
• Diez, David. Barr,Christopher.Cetinkaya-Rundel, Mine. OpenIntroStatisticsThird
Edition. 2016.
• Ames Housing dataset (2016). https://www.kaggle.com/c/house-prices-advanced-
regression-techniques/data adresinde mevcuttur.

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Bitirme Projesi Sunumu

  • 1. REGRESYON ANALİZİ İLEVERİ BİLİMİ UYGULAMASI ŞÜHEDAACAR 1121221008 Proje Danışmanı:Yrd. Doç. Dr.AYLA GÜLCÜ
  • 3. VERİ ÖN İŞLEME 1. Veri temizleme (Data cleaning) Eksik verilerin doldurulması, Gürültülü verinin düzeltilmesi 2. Veri birleştirme (Data integration) Farklı veri dosyalarının birleştirilmesi 3. Veri dönüştürme (Data transformations) Verinin uygun formata dönüştürülmesi, Normalleştirme 4. Veri indirgeme (Data reduction) Gereksiz verilerin ortadan kaldırılması
  • 4. REGRESYON ANALİZİ • Regresyon analizinde yapılan; veriden elde edilen bazı özelliklerin girdi olarak alınması ile numerik değerlerin tahmin edilmesidir. • Francis Galton, 1877’ de, ilk regresyon uygulamasını, bir bezelye tohumunun boyutunu -atalarının boyutlarını da gözlemleyerek- hesaplamak için kullanmıştır.
  • 5. Basit regresyon (Simple regression) • Tek girdi ve çıktı üzerinden veri ile sadece basit bir model oluşturuyoruz.
  • 6. Çoklu regresyon (Multiple regression) – Birden çok özellikle lineer regresyon • Birden çok özellik kullanılarak uygulanan lineer regresyon çeşidi çoklu regresyondur. • Tek girdili model iyi bir prediktif model değildir, çünkü sadece evlerin alanına bakarak tahminde bulunmak yanıltıcı olabilir.
  • 7. UYGULAMA VERİTANIMI • Ames Housing veri seti, Amerika Birleşik Devletleri'nin Iowa eyaletinde yer alanAmes şehrinin konutlarının tanımlandığıAmes Assessor’s Office’ inden alınmış bir veri setidir. • Bu veri setiAmes’ te 2006 yılından 2010 yılına kadar satılmış bireysel konutların bilgilerini içermektedir. • Buradan elde edilen veri seti Dean De Cock tarafından veri bilimi eğitimde kullanılmak üzere derlenmiştir. • https://www.kaggle.com/c/house-prices-advanced-regression- techniques/data
  • 9. Amaç • Veri setindeki evlerin özellikleri göz önünde bulundurularak karşımıza çıkacak yeni bir evin fiyatının ne olabileceği tahmin edilmek istenmiştir. Bunun için en uygun lineer regresyon modeli belirlenmeye çalışılmıştır.
  • 10. Kategorik ve Sayısal Özelliklerin Belirlenmesi • İlk olarak veri özellikleri sayısallık ve kategoriklik açısından incelenmelidir. • Gerçekte kategorik özellikler sayısal bir özellik olarak görülmüş ve bu durum düzeltilmelidir. • Son durumda 34 sayısal ve 47 kategorik özellik elde edilmiştir.
  • 11. Kategorik Özelliklerin Sayısal Değere Dönüştürülmesi • Bu işlem için sklearn.preprocessing paketi kullanılmıştır. Bu sayede kategorik değerler, ölçeklendirilmiş değerler ile belli bir sıralamaya koyularak sayısal değerlere çevrilmiştir.
  • 12. Özelliklerin Değerlendirilmesi • Sadece satış durumunun normal olduğu durumlarda incelemesi yapılmıştır. • Normal durumlar dışında ticaret ile satış, ipotekli malın haczi ile satış, aile üyeleri arasında satış gibi durumların incelenmesi bu uygulamada gerekli görülmemiştir.
  • 13. Özellik değerlerinin görselleştirilmesi • Özelliklerin hangi değerlerde yoğunlaştığının görülebilmesi için histogramlar çizilmiş, • Tüm özelliklerin evin fiyatları ile ilişkisinin anlaşılabilmesi için scatter plotlar çizilmiş ve • Outlier’ ların belirlenebilmesi için boxplot üzerinde veri dağılımları gösterilmiştir.
  • 14. • Train verisi  %80 • Regresyon modeli oluşturulur. • Test verisi  %20 • Model üzerinde tahmin yapılır. Regresyon Uygulaması
  • 16. 5-fold CrossValidation • Veri 5 farklı bloğa bölünür. Gözlemler her blok içerisinde rastgele atanmıştır. Algoritmanın her bir adımı için aynı şekilde veri ayırma işlemi gerçekleşecektir
  • 17. Outlier Değerlerin Elenmesi • Veri yığılmasının oldukça dışında olan değerler outlier olarak adlandırılır. • Gürültüye yol açan bu değerler temizlenmelidir. • Residual değerlerinin en yükseklerinin %20 lik kısmı seçilerek modelden atılmıştır.
  • 18. Outlier Eleme İşleminden Sonra Çıktılar
  • 19. Sonuç Tüm train verisi üzerinde regresyon işlemi uygulanmıştır. o MSE: 469184621.69 o R squared: 0.89 o CrossValidation: MSE mean: 524895858.367 R squared: 0.889  Verilerin çok fazla yoğunlaşmadığı, dışarıda kalan, veri uç noktaları elenmiştir. Bu uç noktalar elenmiştir.  Outlier’ ların elenmesinde sonra tekrar regresyon işlemi uygulanmıştır. o MSE: 134879378.86 o R squared: 0.96 o CrossValidation: MSE mean: 136011541.317 R squared: 0.958  Hatayı minimuma indiren, en uygun regresyon modeline ulaşılmıştır.
  • 20. KAYNAKLAR • Fox, E. ve Guestrin,C. (2016). Machine Learning: Regression byWashington University, https://www.coursera.org/learn/ml-regression/home/welcome adresinden elde edilmiştir. • Diez, David. Barr,Christopher.Cetinkaya-Rundel, Mine. OpenIntroStatisticsThird Edition. 2016. • Ames Housing dataset (2016). https://www.kaggle.com/c/house-prices-advanced- regression-techniques/data adresinde mevcuttur.