Python Veri Bilimi El Kitabı

Mar 31 2023
.
  1. IPython: Normal Python'un Ötesinde
  2. NumPy'ye Giriş
  3. Pandalar ile Veri Manipülasyonu
  4. Matplotlib ile Görselleştirme
  1. Makine Öğrenimine Başlarken
  2. Verilerden Öğrenmek
  3. Doğrusal Regresyon
  4. Naif bayanlar
  5. k-En Yakın Komşular
  6. Scikit-Learn ile Makine Öğrenimine Giriş
  7. Uygulamada Makine Öğrenimi
  8. Önyargı-Varyans Takas
  9. Çekirdek Yoğunluğu Tahmini
  10. Temel bileşenler Analizi
  11. Çok Yönlü Öğrenme
  12. Kümeleme
  13. Karar Ağaçları ve Rastgele Ormanlar
  14. Gradyan Tabanlı Optimizasyon
  15. K-Kümeleme anlamına gelir
  16. Derinlemesine: Naive Bayes Sınıflandırması
  17. Derinlemesine: Lineer Regresyon
  18. Derinlemesine: Vektör Makinelerini Destekleyin
  19. Derinlemesine: Karar Ağaçları ve Rastgele Ormanlar
  20. Derinlemesine: Temel Bileşen Analizi
  21. Derinlemesine: Çok Yönlü Öğrenme
  22. Derinlemesine: k-Kümeleme anlamına gelir
  1. Bir Kasırga Python Turu
  2. Python Dilinin Temelleri
  3. IPython: Normal Python'un Ötesinde
  4. Dizi
  5. IPython Sistem Kabuğu hakkında daha fazlası
  6. Matplotlib
  7. SciPy
  8. Scikit-Öğren
  9. Scikit-Learn ile Makine Öğrenimi
  10. Diğer Makine Öğrenimi Kaynakları
  11. Pratik Makine Öğrenimi: Basit Bir Örnek
  12. Kaynakça

import numpy as np

# create a 1D array
a = np.array([0, 1, 2, 3, 4])
print(a)

import pandas as pd

# create a Pandas DataFrame
data = {'name': ['Alice', 'Bob', 'Charlie', 'David'],
        'age': [25, 32, 18, 47],
        'gender': ['F', 'M', 'M', 'M']}
df = pd.DataFrame(data)
print(df)

# filter rows based on a condition
df_filtered = df[df['age'] > 30]
print(df_filtered)

# group data by a column and compute statistics
grouped_data = df.groupby('gender')['age'].mean()
print(grouped_data)

import matplotlib.pyplot as plt
import numpy as np

# create some data to plot
x = np.linspace(0, 10, 100)
y = np.sin(x)

# create a line plot
plt.plot(x, y)
plt.title('Sine Wave')
plt.xlabel('x')
plt.ylabel('y')
plt.show()

# create a scatter plot
x = np.random.randn(100)
y = np.random.randn(100)
plt.scatter(x, y)
plt.title('Random Data')
plt.xlabel('x')
plt.ylabel('y')
plt.show()

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier

# load the iris dataset
iris = load_iris()

# split the data into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(iris['data'], iris['target'], random_state=0)

# create a K-Nearest Neighbors classifier
knn = KNeighborsClassifier(n_neighbors=1)

# fit the classifier to the training data
knn.fit(X_train, y_train)

# predict the classes of the test data
y_pred = knn.predict(X_test)

# compute the accuracy of the classifier
accuracy = knn.score(X_test, y_test)
print('Accuracy:', accuracy)