{
 "nbformat": 4,
 "nbformat_minor": 5,
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "version": "3.10.0"
  },
  "colab": {
   "provenance": []
  }
 },
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "-6t7b7xh2njs"
   },
   "source": "# QML Quantum Data Encoding Tool (Eğitim Amaçlı)\n\n**Veri tipi:** Tabular / Image / Geospatial  \n**+ GDPR-KVKK uyumlu Anonymisation / Deanonymisation**  \n**Qiskit ile otomatik quantum data encoding**\n\n---\n\n### Özellikler\n1. Başlangıçta veri tipi sorulur (tabular / image / geospatial)\n2. Veri tipine göre otomatik encoding seçimi\n3. Tabular + GDPR/KVKK → hassas özellikler için anonymisation + deanonymisation\n4. Qiskit ile circuit üretimi ve görselleştirme\n\n### Desteklenen Encoding Yöntemleri\n| Encoding | Tabular | Image | Geospatial |\n|----------|---------|-------|------------|\n| Angle Encoding | ✅ | ✅ | ✅ |\n| Amplitude Encoding | ✅ | ✅ | ✅ |\n| ZZFeatureMap | ✅ | - | - |\n| ZFeatureMap | ✅ | - | - |\n\n---\n**Not:** Bu notebook eğitim amaçlıdır. Gerçek KVKK/GDPR uygulamalarında k-anonymity, differential privacy gibi daha güçlü yöntemler kullanılmalıdır.",
   "id": "-6t7b7xh2njs"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "ajNwGS4Z2nj1"
   },
   "source": "## 1. Kurulum",
   "id": "ajNwGS4Z2nj1"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "AdL4A0xG2nj2",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224086352,
     "user_tz": -180,
     "elapsed": 26473,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "934a7ef6-e231-4b75-d483-a4e9545cff71"
   },
   "source": "# Gerekli kütüphaneleri yükle\n!pip install -q qiskit qiskit-aer qiskit-ibm-runtime qiskit-machine-learning \\\n               pandas numpy matplotlib seaborn scikit-learn openpyxl pillow\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom IPython.display import display, Markdown, clear_output\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\nfrom qiskit import QuantumCircuit\nfrom qiskit.circuit.library import ZZFeatureMap, ZFeatureMap, PauliFeatureMap\nfrom qiskit.quantum_info import Statevector\nfrom qiskit.visualization import plot_bloch_multivector\nfrom qiskit_aer import AerSimulator\n\nprint(\"✅ Kütüphaneler yüklendi.\")",
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.8/9.8 MB\u001b[0m \u001b[31m53.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.4/12.4 MB\u001b[0m \u001b[31m46.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m19.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m282.3/282.3 kB\u001b[0m \u001b[31m6.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m412.6/412.6 kB\u001b[0m \u001b[31m12.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m120.7/120.7 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m94.7/94.7 kB\u001b[0m \u001b[31m3.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.4/2.4 MB\u001b[0m \u001b[31m37.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m224.2/224.2 kB\u001b[0m \u001b[31m6.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.5/54.5 kB\u001b[0m \u001b[31m2.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.6/76.6 kB\u001b[0m \u001b[31m2.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m130.2/130.2 kB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m541.5/541.5 kB\u001b[0m \u001b[31m16.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
      "\u001b[?25h✅ Kütüphaneler yüklendi.\n"
     ]
    }
   ],
   "execution_count": 1,
   "id": "AdL4A0xG2nj2"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "A_YaXWU82nj5"
   },
   "source": "## 2. GDPR / KVKK Anonymisation – Deanonymisation Modülü\n\nEğitim amaçlı, **geri dönüşümlü (reversible)** anonymisation.\n\n- `hash_salt`: SHA-256 tabanlı hash (önerilen)\n- `token`: Sıralı token (TOK_0001, TOK_0002, ...)\n- `noise`: Sayısal verilere gürültü ekleme\n- `generalization`: Aralık genelleme",
   "id": "A_YaXWU82nj5"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "gTP75Jsb2nj6",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224096931,
     "user_tz": -180,
     "elapsed": 60,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "8b84e8d5-6fd7-4efb-8b7e-2348eef04954"
   },
   "source": "class GDPRAnonymizer:\n    \"\"\"\n    Eğitim amaçlı, geri dönüşümlü (reversible) anonymisation.\n    Gerçek üretimde k-anonymity, differential privacy vb. daha güçlü yöntemler kullanılır.\n    Bu sınıf, quantum encoding öncesi hassas veriyi korumak ve\n    encoding sonrası orijinal değere dönebilmek için tasarlanmıştır.\n    \"\"\"\n\n    def __init__(self, method=\"hash_salt\"):\n        \"\"\"\n        method: 'hash_salt' | 'noise' | 'generalization' | 'token'\n        \"\"\"\n        self.method = method\n        self.mapping_ = {}          # orijinal → anonymized\n        self.reverse_mapping_ = {}  # anonymized → orijinal\n        self.sensitive_cols_ = []\n        self.salt_ = \"QML_EDU_2026_SALT\"   # eğitim için sabit; gerçekte rastgele + güvenli saklanır\n\n    def fit_transform(self, df: pd.DataFrame, sensitive_cols: list):\n        \"\"\"Hassas sütunları anonymize et ve mapping'i sakla.\"\"\"\n        self.sensitive_cols_ = sensitive_cols\n        df_anon = df.copy()\n\n        for col in sensitive_cols:\n            if col not in df.columns:\n                print(f\"⚠️ Uyarı: '{col}' sütunu bulunamadı, atlanıyor.\")\n                continue\n\n            original = df[col].astype(str)\n            if self.method == \"hash_salt\":\n                import hashlib\n                anon = original.apply(\n                    lambda x: hashlib.sha256((x + self.salt_).encode()).hexdigest()[:12]\n                )\n            elif self.method == \"noise\":\n                # Sayısal varsayımı\n                if pd.api.types.is_numeric_dtype(df[col]):\n                    noise = np.random.normal(0, 0.15 * (df[col].std() + 1e-6), size=len(df))\n                    anon = (df[col] + noise).round(4)\n                else:\n                    print(f\"⚠️ '{col}' sayısal değil, noise uygulanamadı → hash_salt kullanılıyor.\")\n                    import hashlib\n                    anon = original.apply(\n                        lambda x: hashlib.sha256((x + self.salt_).encode()).hexdigest()[:12]\n                    )\n            elif self.method == \"generalization\":\n                if pd.api.types.is_numeric_dtype(df[col]):\n                    bins = pd.qcut(df[col], q=5, duplicates=\"drop\")\n                    anon = bins.astype(str)\n                else:\n                    anon = original.str[:3] + \"***\"\n            elif self.method == \"token\":\n                unique_vals = original.unique()\n                token_map = {v: f\"TOK_{i:04d}\" for i, v in enumerate(unique_vals)}\n                anon = original.map(token_map)\n            else:\n                raise ValueError(\"Geçersiz method. Seçenekler: hash_salt, noise, generalization, token\")\n\n            # Mapping kaydet (deanonymisation için)\n            for o, a in zip(original, anon):\n                self.mapping_[o] = a\n                self.reverse_mapping_[str(a)] = o\n\n            df_anon[col] = anon\n\n        display(Markdown(\"### 🔒 GDPR/KVKK Anonymisation Uygulandı\"))\n        print(f\"Hassas sütunlar: {sensitive_cols}\")\n        print(f\"Yöntem: {self.method}\")\n        display(df_anon.head())\n        return df_anon\n\n    def inverse_transform(self, df_anon: pd.DataFrame):\n        \"\"\"Anonymized veriyi orijinal değerlere geri çevir (deanonymisation).\"\"\"\n        df_orig = df_anon.copy()\n        for col in self.sensitive_cols_:\n            if col in df_orig.columns:\n                df_orig[col] = df_orig[col].astype(str).map(\n                    lambda x: self.reverse_mapping_.get(x, x)\n                )\n        display(Markdown(\"### 🔓 Deanonymisation (Geri Dönüşüm) Uygulandı\"))\n        display(df_orig.head())\n        return df_orig\n\n    def show_mapping_sample(self, n=5):\n        print(\"Örnek mapping (orijinal → anonymized):\")\n        for i, (k, v) in enumerate(list(self.mapping_.items())[:n]):\n            print(f\"  {k}  →  {v}\")\n\nprint(\"✅ GDPRAnonymizer sınıfı tanımlandı.\")",
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "✅ GDPRAnonymizer sınıfı tanımlandı.\n"
     ]
    }
   ],
   "execution_count": 2,
   "id": "gTP75Jsb2nj6"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "h5swr0cv2nj7"
   },
   "source": "## 3. Ana Encoding Motoru (Veri Tipine Göre)\n\nVeri tipine (tabular / image / geospatial) göre otomatik encoding seçer ve Qiskit circuit üretir.",
   "id": "h5swr0cv2nj7"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "E98X73p72nj8",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224105733,
     "user_tz": -180,
     "elapsed": 49,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "f0839f3f-e1b4-4e11-aacc-8b4996b0805a"
   },
   "source": "class QuantumDataEncoder:\n    \"\"\"\n    Veri tipine (tabular / image / geospatial) göre\n    otomatik encoding seçer ve Qiskit circuit üretir.\n    \"\"\"\n\n    def __init__(self):\n        self.data_type = None\n        self.X = None\n        self.y = None\n        self.n_features = None\n        self.anonymizer = None\n        self.original_df = None\n        self.df_anon = None\n\n    # ---------- 1. Veri Tipi Seçimi ----------\n    def ask_data_type(self):\n        display(Markdown(\"\"\"\n### 📥 Veri Tipinizi Seçin\nLütfen verinizin türünü belirtin:\n\n| Seçenek | Açıklama | Önerilen Encoding |\n|---------|----------|-------------------|\n| **1**   | Tabular (CSV, Excel, DataFrame) | Angle / ZZFeatureMap / Amplitude |\n| **2**   | Image (görüntü, piksel matrisi) | Amplitude / Angle (küçük) |\n| **3**   | Geospatial (koordinat + özellik) | Angle + koordinat özel encoding |\n\n\"\"\"))\n        choice = input(\"Seçiminiz (1 / 2 / 3): \").strip()\n        mapping = {\"1\": \"tabular\", \"2\": \"image\", \"3\": \"geospatial\"}\n        self.data_type = mapping.get(choice, \"tabular\")\n        print(f\"✅ Seçilen veri tipi: **{self.data_type.upper()}**\")\n        return self.data_type\n\n    # ---------- 2. Veri Yükleme & Ön İşleme ----------\n    def load_data(self, file_path=None, df=None, image_array=None,\n                  sensitive_cols=None, anonymize_method=\"hash_salt\",\n                  target_col=None):\n        \"\"\"\n        file_path       : CSV / Excel yolu\n        df              : hazır DataFrame\n        image_array     : numpy array (H, W) veya (H, W, C)\n        sensitive_cols  : GDPR/KVKK hassas sütun listesi (sadece tabular)\n        anonymize_method: 'hash_salt' | 'token' | 'noise' | 'generalization'\n        target_col      : hedef sütun (opsiyonel)\n        \"\"\"\n        if self.data_type is None:\n            self.ask_data_type()\n\n        if self.data_type == \"tabular\":\n            if file_path:\n                if str(file_path).endswith(\".csv\"):\n                    df = pd.read_csv(file_path)\n                else:\n                    df = pd.read_excel(file_path)\n            if df is None:\n                raise ValueError(\"Tabular veri için df veya file_path gerekli.\")\n\n            self.original_df = df.copy()\n            display(Markdown(\"### 📊 Yüklenen Tabular Veri\"))\n            display(df.head())\n\n            # GDPR / KVKK\n            if sensitive_cols:\n                self.anonymizer = GDPRAnonymizer(method=anonymize_method)\n                df = self.anonymizer.fit_transform(df, sensitive_cols)\n                self.df_anon = df.copy()\n\n            # Hedef sütun varsa ayır\n            if target_col and target_col in df.columns:\n                self.y = df[target_col].values\n                df_features = df.drop(columns=[target_col])\n            else:\n                self.y = None\n                df_features = df\n\n            # Sadece sayısal özellikler (encoding için)\n            numeric_df = df_features.select_dtypes(include=[np.number])\n            if numeric_df.empty:\n                raise ValueError(\"Sayısal özellik bulunamadı. Encoding için sayısal sütunlar gerekli.\")\n            self.X = numeric_df.values.astype(float)\n            self.n_features = self.X.shape[1]\n            print(f\"✅ Tabular veri hazır: {self.X.shape[0]} örnek, {self.n_features} özellik\")\n\n        elif self.data_type == \"image\":\n            if image_array is None:\n                raise ValueError(\"Image için image_array (numpy) gerekli.\")\n            img = np.asarray(image_array, dtype=float)\n            # Gri tonlamaya indir (eğitim için)\n            if img.ndim == 3:\n                img = img.mean(axis=2)\n            # Normalize [0, π]\n            img = (img - img.min()) / (img.max() - img.min() + 1e-8) * np.pi\n            self.X = img.flatten().reshape(1, -1)   # tek örnek olarak\n            self.n_features = self.X.shape[1]\n            print(f\"✅ Image verisi hazır: şekil → {self.n_features} piksel\")\n\n        elif self.data_type == \"geospatial\":\n            if df is None and file_path is None:\n                raise ValueError(\"Geospatial için df veya file_path gerekli.\")\n            if file_path:\n                df = pd.read_csv(file_path)\n            self.original_df = df.copy()\n            display(Markdown(\"### 🗺️ Yüklenen Geospatial Veri\"))\n            display(df.head())\n            numeric_df = df.select_dtypes(include=[np.number])\n            self.X = numeric_df.values.astype(float)\n            self.n_features = self.X.shape[1]\n            print(f\"✅ Geospatial veri hazır: {self.X.shape}\")\n\n        # Scaling (Angle / FeatureMap için [0, π] aralığı)\n        from sklearn.preprocessing import MinMaxScaler\n        self.X = MinMaxScaler(feature_range=(0, np.pi)).fit_transform(self.X)\n        return self.X\n\n    # ---------- 3. Otomatik Encoding Önerisi ----------\n    def recommend_encoding(self, algorithm=\"VQC\", device=\"simulator\",\n                           n_qubits_available=20):\n        \"\"\"\n        Veri tipi + algoritma + cihaz kısıtına göre encoding önerir.\n        \"\"\"\n        n = self.n_features\n        qubits_amp = int(np.ceil(np.log2(max(n, 1))))\n\n        if self.data_type == \"tabular\":\n            if algorithm in [\"QSVM\", \"VQC\"] and n <= n_qubits_available:\n                rec = (\"zz_feature_map\",\n                       \"Tabular + VQC/QSVM → ZZFeatureMap (entanglement + kernel için ideal)\")\n            elif n > 16 and qubits_amp <= n_qubits_available:\n                rec = (\"amplitude\",\n                       \"Yüksek boyutlu tabular → Amplitude Encoding (qubit verimli)\")\n            else:\n                rec = (\"angle\",\n                       \"Güvenli ve shallow seçenek → Angle Encoding\")\n\n        elif self.data_type == \"image\":\n            if n <= 64 and device == \"simulator\":  # 8x8\n                rec = (\"amplitude\",\n                       \"Küçük görüntü → Amplitude Encoding (piksel → genlik)\")\n            elif n <= n_qubits_available:\n                rec = (\"angle\",\n                       \"Görüntü pikselleri → Angle Encoding (her piksel bir rotation)\")\n            else:\n                rec = (\"amplitude\",\n                       \"Büyük görüntü → Amplitude (qubit sayısı logaritmik)\")\n\n        elif self.data_type == \"geospatial\":\n            rec = (\"angle\",\n                   \"Geospatial (lat/lon + özellik) → Angle Encoding \"\n                   \"(koordinatlar doğrudan rotation açılarına map edilir)\")\n        else:\n            rec = (\"angle\", \"Varsayılan → Angle Encoding\")\n\n        display(Markdown(f\"### 🎯 Önerilen Encoding: **{rec[0].upper()}**\"))\n        print(rec[1])\n        return rec[0]\n\n    # ---------- 4. Encoding Uygulamaları ----------\n    def encode_amplitude(self, sample_idx=0):\n        x = self.X[sample_idx].copy()\n        norm = np.linalg.norm(x)\n        if norm == 0:\n            x = np.ones_like(x) / np.sqrt(len(x))\n        else:\n            x = x / norm\n        n_qubits = int(np.ceil(np.log2(len(x))))\n        pad = 2**n_qubits - len(x)\n        if pad > 0:\n            x = np.pad(x, (0, pad))\n        qc = QuantumCircuit(n_qubits, name=\"AmplitudeEncoding\")\n        qc.initialize(x, range(n_qubits))\n        return qc\n\n    def encode_angle(self, sample_idx=0, rotation=\"ry\"):\n        x = self.X[sample_idx]\n        n = len(x)\n        # Çok fazla qubit olmasın (eğitim için limit)\n        max_q = min(n, 12)\n        qc = QuantumCircuit(max_q, name=\"AngleEncoding\")\n        for i, val in enumerate(x[:max_q]):\n            if rotation == \"ry\":\n                qc.ry(val, i)\n            elif rotation == \"rx\":\n                qc.rx(val, i)\n            else:\n                qc.rz(val, i)\n        return qc\n\n    def encode_zz_feature_map(self, sample_idx=0, reps=2, entanglement=\"linear\"):\n        n = min(self.n_features, 8)  # eğitim için makul limit\n        fm = ZZFeatureMap(feature_dimension=n, reps=reps, entanglement=entanglement)\n        params = self.X[sample_idx][:n]\n        if len(params) == fm.num_parameters:\n            qc = fm.assign_parameters(params)\n        else:\n            # Parametre sayısı uyuşmazsa sadece şablonu döndür\n            qc = fm\n        return qc\n\n    def encode(self, encoding=\"auto\", algorithm=\"VQC\", device=\"simulator\",\n               sample_idx=0, **kwargs):\n        if encoding == \"auto\":\n            encoding = self.recommend_encoding(algorithm, device)\n\n        display(Markdown(f\"### 🔧 Uygulanan Encoding: **{encoding.upper()}**\"))\n\n        if encoding == \"amplitude\":\n            qc = self.encode_amplitude(sample_idx)\n        elif encoding == \"angle\":\n            qc = self.encode_angle(sample_idx, rotation=kwargs.get(\"rotation\", \"ry\"))\n        elif encoding in [\"zz_feature_map\", \"zz\"]:\n            qc = self.encode_zz_feature_map(sample_idx, **kwargs)\n        else:\n            raise ValueError(f\"Desteklenmeyen encoding: {encoding}\")\n\n        self._visualize(qc, encoding)\n        return qc\n\n    def _visualize(self, qc, encoding):\n        print(f\"Qubit: {qc.num_qubits} | Depth: {qc.depth()}\")\n        try:\n            display(qc.draw(\"mpl\", style=\"iqp\", fold=40))\n        except Exception as e:\n            print(f\"Circuit çizilemedi (text):\\n{qc.draw()}\")\n\n        if qc.num_qubits <= 5 and qc.num_parameters == 0:\n            try:\n                sv = Statevector.from_instruction(qc)\n                display(Markdown(\"#### Statevector (ilk 8 genlik)\"))\n                print(np.round(sv.data[:8], 4))\n            except Exception:\n                pass\n\n        display(Markdown(f\"\"\"\n**Öğrenci Notu**\n- Veri tipi: `{self.data_type}`\n- Encoding: `{encoding}`\n- GDPR/KVKK anonymisation uygulandı mı? → `{self.anonymizer is not None}`\n\"\"\"))\n\nprint(\"✅ QuantumDataEncoder sınıfı tanımlandı.\")",
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "✅ QuantumDataEncoder sınıfı tanımlandı.\n"
     ]
    }
   ],
   "execution_count": 3,
   "id": "E98X73p72nj8"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "K3U7SEmE2nj9"
   },
   "source": "## 4. Senaryo A — Tabular + GDPR/KVKK\n\nKişisel veri içeren örnek tabular veri seti ile anonymisation + quantum encoding.",
   "id": "K3U7SEmE2nj9"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000
    },
    "id": "QV9CnkF62nj-",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224118693,
     "user_tz": -180,
     "elapsed": 1237,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "8a273477-d00d-4b7f-e777-f83958c115e7"
   },
   "source": "print(\"=\" * 60)\nprint(\"SENARYO A: Tabular veri + GDPR/KVKK hassas özellikler\")\nprint(\"=\" * 60)\n\n# Örnek tabular veri (kişisel veri içeren)\nnp.random.seed(42)\ndf_demo = pd.DataFrame({\n    \"yas\": np.random.randint(18, 70, 20),\n    \"gelir\": np.random.randint(20000, 120000, 20),\n    \"sehir_kodu\": np.random.randint(1, 81, 20),\n    \"tc_kimlik_ornek\": [f\"10000000{i:02d}\" for i in range(20)],   # hassas\n    \"email_ornek\": [f\"kisi{i}@ornek.com\" for i in range(20)],     # hassas\n    \"label\": np.random.randint(0, 2, 20)\n})\n\nencoder = QuantumDataEncoder()\nencoder.data_type = \"tabular\"   # soruyu atlamak için doğrudan set\n\n# Hassas sütunları belirt\nsensitive = [\"tc_kimlik_ornek\", \"email_ornek\"]\n\nX = encoder.load_data(\n    df=df_demo,\n    sensitive_cols=sensitive,\n    anonymize_method=\"hash_salt\",   # veya \"token\", \"noise\", \"generalization\"\n    target_col=\"label\"\n)\n\n# Mapping örneği\nif encoder.anonymizer:\n    encoder.anonymizer.show_mapping_sample(n=5)\n\n# Otomatik encoding\nqc = encoder.encode(\n    encoding=\"auto\",\n    algorithm=\"VQC\",\n    device=\"simulator\",\n    sample_idx=0,\n    reps=2\n)",
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "============================================================\n",
      "SENARYO A: Tabular veri + GDPR/KVKK hassas özellikler\n",
      "============================================================\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 📊 Yüklenen Tabular Veri"
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "   yas   gelir  sehir_kodu tc_kimlik_ornek      email_ornek  label\n",
       "0   56   82955          64      1000000000  kisi0@ornek.com      1\n",
       "1   69   84925           3      1000000001  kisi1@ornek.com      0\n",
       "2   46   87969          51      1000000002  kisi2@ornek.com      1\n",
       "3   32   25311           7      1000000003  kisi3@ornek.com      1\n",
       "4   60  103104          21      1000000004  kisi4@ornek.com      1"
      ],
      "text/html": [
       "\n",
       "  <div id=\"df-8db856c8-539d-43da-92e3-03eb2fab8b9a\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>yas</th>\n",
       "      <th>gelir</th>\n",
       "      <th>sehir_kodu</th>\n",
       "      <th>tc_kimlik_ornek</th>\n",
       "      <th>email_ornek</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>56</td>\n",
       "      <td>82955</td>\n",
       "      <td>64</td>\n",
       "      <td>1000000000</td>\n",
       "      <td>kisi0@ornek.com</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>69</td>\n",
       "      <td>84925</td>\n",
       "      <td>3</td>\n",
       "      <td>1000000001</td>\n",
       "      <td>kisi1@ornek.com</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>46</td>\n",
       "      <td>87969</td>\n",
       "      <td>51</td>\n",
       "      <td>1000000002</td>\n",
       "      <td>kisi2@ornek.com</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>32</td>\n",
       "      <td>25311</td>\n",
       "      <td>7</td>\n",
       "      <td>1000000003</td>\n",
       "      <td>kisi3@ornek.com</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>60</td>\n",
       "      <td>103104</td>\n",
       "      <td>21</td>\n",
       "      <td>1000000004</td>\n",
       "      <td>kisi4@ornek.com</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-8db856c8-539d-43da-92e3-03eb2fab8b9a')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-8db856c8-539d-43da-92e3-03eb2fab8b9a button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-8db856c8-539d-43da-92e3-03eb2fab8b9a');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "summary": "{\n  \"name\": \")\",\n  \"rows\": 5,\n  \"fields\": [\n    {\n      \"column\": \"yas\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 14,\n        \"min\": 32,\n        \"max\": 69,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          69,\n          60,\n          46\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"gelir\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 29881,\n        \"min\": 25311,\n        \"max\": 103104,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          84925,\n          103104,\n          87969\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"sehir_kodu\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 27,\n        \"min\": 3,\n        \"max\": 64,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          3,\n          21,\n          51\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"tc_kimlik_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"1000000001\",\n          \"1000000004\",\n          \"1000000002\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"email_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"kisi1@ornek.com\",\n          \"kisi4@ornek.com\",\n          \"kisi2@ornek.com\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"label\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 0,\n        \"max\": 1,\n        \"num_unique_values\": 2,\n        \"samples\": [\n          0,\n          1\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
      }
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🔒 GDPR/KVKK Anonymisation Uygulandı"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Hassas sütunlar: ['tc_kimlik_ornek', 'email_ornek']\n",
      "Yöntem: hash_salt\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "   yas   gelir  sehir_kodu tc_kimlik_ornek   email_ornek  label\n",
       "0   56   82955          64    527649e99f28  dbb6a8c039ff      1\n",
       "1   69   84925           3    fc387a80a373  bea1c52dfff0      0\n",
       "2   46   87969          51    2d522d418315  d74efdfa82f1      1\n",
       "3   32   25311           7    cea0cbe63d36  48f21758d0c7      1\n",
       "4   60  103104          21    5b2a6cd97c67  433a9685e7c4      1"
      ],
      "text/html": [
       "\n",
       "  <div id=\"df-e48d46ba-50ec-4edf-b09f-163a4bb1075e\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>yas</th>\n",
       "      <th>gelir</th>\n",
       "      <th>sehir_kodu</th>\n",
       "      <th>tc_kimlik_ornek</th>\n",
       "      <th>email_ornek</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>56</td>\n",
       "      <td>82955</td>\n",
       "      <td>64</td>\n",
       "      <td>527649e99f28</td>\n",
       "      <td>dbb6a8c039ff</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>69</td>\n",
       "      <td>84925</td>\n",
       "      <td>3</td>\n",
       "      <td>fc387a80a373</td>\n",
       "      <td>bea1c52dfff0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>46</td>\n",
       "      <td>87969</td>\n",
       "      <td>51</td>\n",
       "      <td>2d522d418315</td>\n",
       "      <td>d74efdfa82f1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>32</td>\n",
       "      <td>25311</td>\n",
       "      <td>7</td>\n",
       "      <td>cea0cbe63d36</td>\n",
       "      <td>48f21758d0c7</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>60</td>\n",
       "      <td>103104</td>\n",
       "      <td>21</td>\n",
       "      <td>5b2a6cd97c67</td>\n",
       "      <td>433a9685e7c4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-e48d46ba-50ec-4edf-b09f-163a4bb1075e')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-e48d46ba-50ec-4edf-b09f-163a4bb1075e button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-e48d46ba-50ec-4edf-b09f-163a4bb1075e');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "summary": "{\n  \"name\": \")\",\n  \"rows\": 5,\n  \"fields\": [\n    {\n      \"column\": \"yas\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 14,\n        \"min\": 32,\n        \"max\": 69,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          69,\n          60,\n          46\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"gelir\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 29881,\n        \"min\": 25311,\n        \"max\": 103104,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          84925,\n          103104,\n          87969\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"sehir_kodu\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 27,\n        \"min\": 3,\n        \"max\": 64,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          3,\n          21,\n          51\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"tc_kimlik_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"fc387a80a373\",\n          \"5b2a6cd97c67\",\n          \"2d522d418315\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"email_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"bea1c52dfff0\",\n          \"433a9685e7c4\",\n          \"d74efdfa82f1\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"label\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 0,\n        \"max\": 1,\n        \"num_unique_values\": 2,\n        \"samples\": [\n          0,\n          1\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
      }
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "✅ Tabular veri hazır: 20 örnek, 3 özellik\n",
      "Örnek mapping (orijinal → anonymized):\n",
      "  1000000000  →  527649e99f28\n",
      "  1000000001  →  fc387a80a373\n",
      "  1000000002  →  2d522d418315\n",
      "  1000000003  →  cea0cbe63d36\n",
      "  1000000004  →  5b2a6cd97c67\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🎯 Önerilen Encoding: **ZZ_FEATURE_MAP**"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Tabular + VQC/QSVM → ZZFeatureMap (entanglement + kernel için ideal)\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🔧 Uygulanan Encoding: **ZZ_FEATURE_MAP**"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Qubit: 3 | Depth: 1\n",
      "Circuit çizilemedi (text):\n",
      "     ┌─────────────────────────────────────┐\n",
      "q_0: ┤0                                    ├\n",
      "     │                                     │\n",
      "q_1: ┤1 ZZFeatureMap(2.3248,2.0954,2.7434) ├\n",
      "     │                                     │\n",
      "q_2: ┤2                                    ├\n",
      "     └─────────────────────────────────────┘\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "#### Statevector (ilk 8 genlik)"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "[ 0.5142+0.0588j  0.3181-0.1484j  0.4364+0.2077j  0.3276-0.0554j\n",
      " -0.0324+0.006j   0.1249+0.3396j -0.011 -0.0404j  0.3484-0.0988j]\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "\n**Öğrenci Notu**  \n- Veri tipi: `tabular`  \n- Encoding: `zz_feature_map`  \n- GDPR/KVKK anonymisation uygulandı mı? → `True`\n"
     },
     "metadata": {}
    }
   ],
   "execution_count": 4,
   "id": "QV9CnkF62nj-"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 562
    },
    "id": "66AY5TYI2nj_",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224137763,
     "user_tz": -180,
     "elapsed": 167,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "2cc2a982-3348-4d5b-8c87-ee30a9a16559"
   },
   "source": "# Deanonymisation örneği (orijinale geri dönüş)\nif encoder.anonymizer and encoder.df_anon is not None:\n    print(\"\\n--- Deanonymisation (orijinale dönüş) ---\")\n    df_recovered = encoder.anonymizer.inverse_transform(encoder.df_anon)\n    print(\"\\nOrijinal ile karşılaştırma (ilk 3 satır):\")\n    display(encoder.original_df[[\"tc_kimlik_ornek\", \"email_ornek\"]].head(3))\n    display(df_recovered[[\"tc_kimlik_ornek\", \"email_ornek\"]].head(3))",
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "\n",
      "--- Deanonymisation (orijinale dönüş) ---\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🔓 Deanonymisation (Geri Dönüşüm) Uygulandı"
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "   yas   gelir  sehir_kodu tc_kimlik_ornek      email_ornek  label\n",
       "0   56   82955          64      1000000000  kisi0@ornek.com      1\n",
       "1   69   84925           3      1000000001  kisi1@ornek.com      0\n",
       "2   46   87969          51      1000000002  kisi2@ornek.com      1\n",
       "3   32   25311           7      1000000003  kisi3@ornek.com      1\n",
       "4   60  103104          21      1000000004  kisi4@ornek.com      1"
      ],
      "text/html": [
       "\n",
       "  <div id=\"df-84e55c37-b8e3-49af-a5cd-d4aa32d06c6f\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>yas</th>\n",
       "      <th>gelir</th>\n",
       "      <th>sehir_kodu</th>\n",
       "      <th>tc_kimlik_ornek</th>\n",
       "      <th>email_ornek</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>56</td>\n",
       "      <td>82955</td>\n",
       "      <td>64</td>\n",
       "      <td>1000000000</td>\n",
       "      <td>kisi0@ornek.com</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>69</td>\n",
       "      <td>84925</td>\n",
       "      <td>3</td>\n",
       "      <td>1000000001</td>\n",
       "      <td>kisi1@ornek.com</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>46</td>\n",
       "      <td>87969</td>\n",
       "      <td>51</td>\n",
       "      <td>1000000002</td>\n",
       "      <td>kisi2@ornek.com</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>32</td>\n",
       "      <td>25311</td>\n",
       "      <td>7</td>\n",
       "      <td>1000000003</td>\n",
       "      <td>kisi3@ornek.com</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>60</td>\n",
       "      <td>103104</td>\n",
       "      <td>21</td>\n",
       "      <td>1000000004</td>\n",
       "      <td>kisi4@ornek.com</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-84e55c37-b8e3-49af-a5cd-d4aa32d06c6f')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-84e55c37-b8e3-49af-a5cd-d4aa32d06c6f button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-84e55c37-b8e3-49af-a5cd-d4aa32d06c6f');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "summary": "{\n  \"name\": \"    display(df_recovered[[\\\"tc_kimlik_ornek\\\", \\\"email_ornek\\\"]]\",\n  \"rows\": 5,\n  \"fields\": [\n    {\n      \"column\": \"yas\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 14,\n        \"min\": 32,\n        \"max\": 69,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          69,\n          60,\n          46\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"gelir\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 29881,\n        \"min\": 25311,\n        \"max\": 103104,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          84925,\n          103104,\n          87969\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"sehir_kodu\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 27,\n        \"min\": 3,\n        \"max\": 64,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          3,\n          21,\n          51\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"tc_kimlik_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"1000000001\",\n          \"1000000004\",\n          \"1000000002\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"email_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"kisi1@ornek.com\",\n          \"kisi4@ornek.com\",\n          \"kisi2@ornek.com\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"label\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 0,\n        \"max\": 1,\n        \"num_unique_values\": 2,\n        \"samples\": [\n          0,\n          1\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
      }
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "\n",
      "Orijinal ile karşılaştırma (ilk 3 satır):\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "  tc_kimlik_ornek      email_ornek\n",
       "0      1000000000  kisi0@ornek.com\n",
       "1      1000000001  kisi1@ornek.com\n",
       "2      1000000002  kisi2@ornek.com"
      ],
      "text/html": [
       "\n",
       "  <div id=\"df-60182490-309d-4132-99b0-4c6e1ba0d9ab\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>tc_kimlik_ornek</th>\n",
       "      <th>email_ornek</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1000000000</td>\n",
       "      <td>kisi0@ornek.com</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1000000001</td>\n",
       "      <td>kisi1@ornek.com</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1000000002</td>\n",
       "      <td>kisi2@ornek.com</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-60182490-309d-4132-99b0-4c6e1ba0d9ab')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-60182490-309d-4132-99b0-4c6e1ba0d9ab button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-60182490-309d-4132-99b0-4c6e1ba0d9ab');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "summary": "{\n  \"name\": \"    display(df_recovered[[\\\"tc_kimlik_ornek\\\", \\\"email_ornek\\\"]]\",\n  \"rows\": 3,\n  \"fields\": [\n    {\n      \"column\": \"tc_kimlik_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"1000000000\",\n          \"1000000001\",\n          \"1000000002\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"email_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"kisi0@ornek.com\",\n          \"kisi1@ornek.com\",\n          \"kisi2@ornek.com\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
      }
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "  tc_kimlik_ornek      email_ornek\n",
       "0      1000000000  kisi0@ornek.com\n",
       "1      1000000001  kisi1@ornek.com\n",
       "2      1000000002  kisi2@ornek.com"
      ],
      "text/html": [
       "\n",
       "  <div id=\"df-315ff9e1-7d8f-4759-acf7-d45df33a8f05\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>tc_kimlik_ornek</th>\n",
       "      <th>email_ornek</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1000000000</td>\n",
       "      <td>kisi0@ornek.com</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1000000001</td>\n",
       "      <td>kisi1@ornek.com</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1000000002</td>\n",
       "      <td>kisi2@ornek.com</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-315ff9e1-7d8f-4759-acf7-d45df33a8f05')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-315ff9e1-7d8f-4759-acf7-d45df33a8f05 button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-315ff9e1-7d8f-4759-acf7-d45df33a8f05');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "summary": "{\n  \"name\": \"    display(df_recovered[[\\\"tc_kimlik_ornek\\\", \\\"email_ornek\\\"]]\",\n  \"rows\": 3,\n  \"fields\": [\n    {\n      \"column\": \"tc_kimlik_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"1000000000\",\n          \"1000000001\",\n          \"1000000002\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"email_ornek\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"kisi0@ornek.com\",\n          \"kisi1@ornek.com\",\n          \"kisi2@ornek.com\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
      }
     },
     "metadata": {}
    }
   ],
   "execution_count": 5,
   "id": "66AY5TYI2nj_"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "rka5oOv42nj_"
   },
   "source": "## 5. Senaryo B — Image Verisi",
   "id": "rka5oOv42nj_"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000
    },
    "id": "ZcKR18l32nkA",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224145525,
     "user_tz": -180,
     "elapsed": 376,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "1d9981ff-320b-4885-8cbc-1cd1961436d1"
   },
   "source": "print(\"\\n\" + \"=\" * 60)\nprint(\"SENARYO B: Image (küçük gri tonlama görüntü)\")\nprint(\"=\" * 60)\n\n# 4x4 örnek görüntü\nnp.random.seed(7)\nimg = np.random.rand(4, 4) * 255\nprint(\"Orijinal görüntü (4x4):\")\nplt.figure(figsize=(4, 4))\nplt.imshow(img, cmap=\"gray\")\nplt.colorbar()\nplt.title(\"Örnek Görüntü\")\nplt.show()\n\nencoder_img = QuantumDataEncoder()\nencoder_img.data_type = \"image\"\nX_img = encoder_img.load_data(image_array=img)\n\nqc_img = encoder_img.encode(\n    encoding=\"auto\",\n    algorithm=\"VQC\",\n    device=\"simulator\",\n    sample_idx=0\n)",
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "\n",
      "============================================================\n",
      "SENARYO B: Image (küçük gri tonlama görüntü)\n",
      "============================================================\n",
      "Orijinal görüntü (4x4):\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<Figure size 400x400 with 2 Axes>"
      ],
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAFICAYAAABeEjU2AAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAMLpJREFUeJz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bdPHqlUtmiefTV1dWdch49h26ISHZa0r/tzH1iBj0RyQ6DnohI4hj0REQSx6AnIpI4uQU9b5giIpI49uiJSHbk1qNn0BORLHXm4LYUh26ISDaUSmWrFhrUaDRQKpVtWFH74J2xRCQrd+/eRXV1dYvOVSqVsLOza+OKxMegJyKSOA7dEBFJHIOeiEjiGPRERBLHoCcikjgGPRGRxDHoiYgkjkFPRCRx/w/K4P13sGnMBwAAAABJRU5ErkJggg==\n"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "✅ Image verisi hazır: şekil → 16 piksel\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🎯 Önerilen Encoding: **AMPLITUDE**"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Küçük görüntü → Amplitude Encoding (piksel → genlik)\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🔧 Uygulanan Encoding: **AMPLITUDE**"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Qubit: 4 | Depth: 1\n",
      "Circuit çizilemedi (text):\n",
      "     »\n",
      "q_0: »\n",
      "     »\n",
      "q_1: »\n",
      "     »\n",
      "q_2: »\n",
      "     »\n",
      "q_3: »\n",
      "     »\n",
      "«     ┌──────────────────────────────────────────────────────────────────────────────────────────────┐\n",
      "«q_0: ┤0                                                                                             ├\n",
      "«     │                                                                                              │\n",
      "«q_1: ┤1                                                                                             ├\n",
      "«     │  Initialize(0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25) │\n",
      "«q_2: ┤2                                                                                             ├\n",
      "«     │                                                                                              │\n",
      "«q_3: ┤3                                                                                             ├\n",
      "«     └──────────────────────────────────────────────────────────────────────────────────────────────┘\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "#### Statevector (ilk 8 genlik)"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "[0.25+0.j 0.25+0.j 0.25+0.j 0.25+0.j 0.25+0.j 0.25+0.j 0.25+0.j 0.25+0.j]\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "\n**Öğrenci Notu**  \n- Veri tipi: `image`  \n- Encoding: `amplitude`  \n- GDPR/KVKK anonymisation uygulandı mı? → `False`\n"
     },
     "metadata": {}
    }
   ],
   "execution_count": 6,
   "id": "ZcKR18l32nkA"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "vSQiTR7m2nkB"
   },
   "source": "## 6. Senaryo C — Geospatial Verisi",
   "id": "vSQiTR7m2nkB"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 774
    },
    "id": "KA3rcInh2nkB",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224151944,
     "user_tz": -180,
     "elapsed": 88,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "bc9b368b-ede0-487d-efe6-086e48680a40"
   },
   "source": "print(\"\\n\" + \"=\" * 60)\nprint(\"SENARYO C: Geospatial (lat, lon + özellik)\")\nprint(\"=\" * 60)\n\nnp.random.seed(42)\ndf_geo = pd.DataFrame({\n    \"latitude\": np.random.uniform(36, 42, 15),\n    \"longitude\": np.random.uniform(26, 45, 15),\n    \"yagis_mm\": np.random.uniform(0, 100, 15),\n    \"sicaklik\": np.random.uniform(5, 35, 15)\n})\n\nencoder_geo = QuantumDataEncoder()\nencoder_geo.data_type = \"geospatial\"\nX_geo = encoder_geo.load_data(df=df_geo)\n\nqc_geo = encoder_geo.encode(\n    encoding=\"auto\",\n    algorithm=\"VQC\",\n    device=\"simulator\",\n    sample_idx=0\n)",
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "\n",
      "============================================================\n",
      "SENARYO C: Geospatial (lat, lon + özellik)\n",
      "============================================================\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🗺️ Yüklenen Geospatial Veri"
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "    latitude  longitude   yagis_mm   sicaklik\n",
       "0  38.247241  29.484686  60.754485  24.875669\n",
       "1  41.704286  31.780603  17.052412  14.351332\n",
       "2  40.391964  35.970372   6.505159  20.602041\n",
       "3  39.591951  34.206955  94.888554  21.401308\n",
       "4  36.936112  31.533354  96.563203  10.545634"
      ],
      "text/html": [
       "\n",
       "  <div id=\"df-d7f48d6c-a07e-43d0-8a5b-015741a7171a\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>latitude</th>\n",
       "      <th>longitude</th>\n",
       "      <th>yagis_mm</th>\n",
       "      <th>sicaklik</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>38.247241</td>\n",
       "      <td>29.484686</td>\n",
       "      <td>60.754485</td>\n",
       "      <td>24.875669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>41.704286</td>\n",
       "      <td>31.780603</td>\n",
       "      <td>17.052412</td>\n",
       "      <td>14.351332</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>40.391964</td>\n",
       "      <td>35.970372</td>\n",
       "      <td>6.505159</td>\n",
       "      <td>20.602041</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>39.591951</td>\n",
       "      <td>34.206955</td>\n",
       "      <td>94.888554</td>\n",
       "      <td>21.401308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>36.936112</td>\n",
       "      <td>31.533354</td>\n",
       "      <td>96.563203</td>\n",
       "      <td>10.545634</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-d7f48d6c-a07e-43d0-8a5b-015741a7171a')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-d7f48d6c-a07e-43d0-8a5b-015741a7171a button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-d7f48d6c-a07e-43d0-8a5b-015741a7171a');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "summary": "{\n  \"name\": \")\",\n  \"rows\": 5,\n  \"fields\": [\n    {\n      \"column\": \"latitude\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 1.852489497711731,\n        \"min\": 36.93611184265462,\n        \"max\": 41.7042858384595,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          41.7042858384595,\n          36.93611184265462,\n          40.39196365086843\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"longitude\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 2.522693428538092,\n        \"min\": 29.484685687215244,\n        \"max\": 35.97037220101252,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          31.780602616231217,\n          31.533353663762796,\n          35.97037220101252\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"yagis_mm\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 42.259209016028876,\n        \"min\": 6.505159298527952,\n        \"max\": 96.56320330745594,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          17.052412368729154,\n          96.56320330745594,\n          6.505159298527952\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"sicaklik\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 5.784977571055062,\n        \"min\": 10.545633665765811,\n        \"max\": 24.87566853061946,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          14.351332282682328,\n          10.545633665765811,\n          20.602040635334326\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
      }
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "✅ Geospatial veri hazır: (15, 4)\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🎯 Önerilen Encoding: **ANGLE**"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Geospatial (lat/lon + özellik) → Angle Encoding (koordinatlar doğrudan rotation açılarına map edilir)\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🔧 Uygulanan Encoding: **ANGLE**"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Qubit: 4 | Depth: 1\n",
      "Circuit çizilemedi (text):\n",
      "      ┌────────────┐\n",
      "q_0: ─┤ Ry(1.1713) ├\n",
      "     ┌┴────────────┤\n",
      "q_1: ┤ Ry(0.58243) ├\n",
      "     └┬────────────┤\n",
      "q_2: ─┤ Ry(1.9336) ├\n",
      "      ├───────────┬┘\n",
      "q_3: ─┤ Ry(2.098) ├─\n",
      "      └───────────┘ \n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "#### Statevector (ilk 8 genlik)"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "[0.226 +0.j 0.1499+0.j 0.0677+0.j 0.0449+0.j 0.3275+0.j 0.2172+0.j\n",
      " 0.0982+0.j 0.0651+0.j]\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "\n**Öğrenci Notu**  \n- Veri tipi: `geospatial`  \n- Encoding: `angle`  \n- GDPR/KVKK anonymisation uygulandı mı? → `False`\n"
     },
     "metadata": {}
    }
   ],
   "execution_count": 7,
   "id": "KA3rcInh2nkB"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "XYIy2un82nkC"
   },
   "source": "## 7. İnteraktif Başlangıç (Kendi Verinizle)\n\nBu hücreyi çalıştırarak interaktif olarak veri tipi seçebilir, hassas sütunları belirtebilir ve encoding yapabilirsiniz.\n\n> **Colab'da kendi dosyanızı yüklemek için:**  \n> `from google.colab import files` → `uploaded = files.upload()` kullanın.",
   "id": "XYIy2un82nkC"
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "ANXH9Bjn2nkD",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224158864,
     "user_tz": -180,
     "elapsed": 9,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    }
   },
   "source": "def interactive_start():\n    encoder = QuantumDataEncoder()\n    data_type = encoder.ask_data_type()\n\n    if data_type == \"tabular\":\n        print(\"\\nCSV/Excel yüklemek ister misiniz?\")\n        print(\"(Colab'da: from google.colab import files; uploaded = files.upload())\")\n        print(\"Şimdilik örnek veriyle devam ediyoruz...\\n\")\n\n        sens = input(\"GDPR/KVKK hassas sütun adlarını virgülle yazın (yoksa Enter): \").strip()\n        sensitive_cols = [s.strip() for s in sens.split(\",\")] if sens else None\n\n        # Örnek veri\n        df = pd.DataFrame({\n            \"feature1\": np.random.randn(30),\n            \"feature2\": np.random.randn(30),\n            \"feature3\": np.random.randn(30),\n            \"ad_soyad\": [f\"Kisi_{i}\" for i in range(30)]  # örnek hassas\n        })\n        if sensitive_cols is None:\n            sensitive_cols = [\"ad_soyad\"]\n\n        method = input(\"Anonymisation yöntemi (hash_salt / token / noise / generalization) [hash_salt]: \").strip() or \"hash_salt\"\n        X = encoder.load_data(df=df, sensitive_cols=sensitive_cols, anonymize_method=method)\n\n    elif data_type == \"image\":\n        print(\"Image için numpy array verin (şimdilik rastgele 8x8)\")\n        img = np.random.rand(8, 8)\n        plt.imshow(img, cmap=\"gray\")\n        plt.title(\"Rastgele 8x8 Görüntü\")\n        plt.show()\n        X = encoder.load_data(image_array=img)\n\n    else:  # geospatial\n        df = pd.DataFrame({\n            \"lat\": np.random.uniform(36, 42, 20),\n            \"lon\": np.random.uniform(26, 45, 20),\n            \"deger\": np.random.randn(20)\n        })\n        X = encoder.load_data(df=df)\n\n    # Encoding parametreleri\n    algo = input(\"Algoritma (VQC / QSVM / Genel) [VQC]: \").strip() or \"VQC\"\n    device = input(\"Cihaz (simulator / ibm_quantum) [simulator]: \").strip() or \"simulator\"\n\n    qc = encoder.encode(encoding=\"auto\", algorithm=algo, device=device, sample_idx=0)\n    return encoder, qc\n\n\n# Çalıştırmak için aşağıdaki satırın yorumunu kaldırın:\n# encoder, qc = interactive_start()",
   "outputs": [],
   "execution_count": 8,
   "id": "ANXH9Bjn2nkD"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "r1-hq_B_2nkE"
   },
   "source": "## 8. Encoding Karşılaştırma Tablosu (Eğitim)",
   "id": "r1-hq_B_2nkE"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 244
    },
    "id": "1xRp6MEd2nkE",
    "executionInfo": {
     "status": "ok",
     "timestamp": 1787224175528,
     "user_tz": -180,
     "elapsed": 51,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "69d0a7f1-d1bb-4b29-fd91-cd629429ec81"
   },
   "source": "def encoding_comparison_table():\n    data = {\n        \"Encoding\": [\"Basis\", \"Amplitude\", \"Angle\", \"Dense Angle\", \"ZZFeatureMap\"],\n        \"Qubit (N özellik)\": [\"N\", \"⌈log₂ N⌉\", \"N\", \"⌈N/2⌉\", \"N\"],\n        \"Circuit Depth\": [\"O(1)\", \"O(N) ~ yüksek\", \"O(1)\", \"O(1)\", \"O(reps × N)\"],\n        \"NISQ Uygunluğu\": [\"Yüksek\", \"Düşük-Orta\", \"Çok Yüksek\", \"Yüksek\", \"Yüksek\"],\n        \"En İyi Kullanım\": [\n            \"Binary veri, toy örnekler\",\n            \"HHL, yüksek boyut, görüntü\",\n            \"VQC, QNN, geospatial\",\n            \"Qubit tasarrufu\",\n            \"QSVM, kernel yöntemleri\"\n        ],\n        \"Qiskit Desteği\": [\"Manuel\", \"initialize()\", \"Manuel / FeatureMap\", \"Manuel\", \"ZZFeatureMap\"]\n    }\n    df_comp = pd.DataFrame(data)\n    display(Markdown(\"### 📋 Encoding Yöntemleri Karşılaştırması\"))\n    display(df_comp)\n\nencoding_comparison_table()",
   "outputs": [
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 📋 Encoding Yöntemleri Karşılaştırması"
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "       Encoding Qubit (N özellik)  Circuit Depth NISQ Uygunluğu  \\\n",
       "0         Basis                 N           O(1)         Yüksek   \n",
       "1     Amplitude          ⌈log₂ N⌉  O(N) ~ yüksek     Düşük-Orta   \n",
       "2         Angle                 N           O(1)     Çok Yüksek   \n",
       "3   Dense Angle             ⌈N/2⌉           O(1)         Yüksek   \n",
       "4  ZZFeatureMap                 N    O(reps × N)         Yüksek   \n",
       "\n",
       "              En İyi Kullanım       Qiskit Desteği  \n",
       "0   Binary veri, toy örnekler               Manuel  \n",
       "1  HHL, yüksek boyut, görüntü         initialize()  \n",
       "2        VQC, QNN, geospatial  Manuel / FeatureMap  \n",
       "3             Qubit tasarrufu               Manuel  \n",
       "4     QSVM, kernel yöntemleri         ZZFeatureMap  "
      ],
      "text/html": [
       "\n",
       "  <div id=\"df-f331002d-52a4-4cdf-8931-55b4dfd9b251\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Encoding</th>\n",
       "      <th>Qubit (N özellik)</th>\n",
       "      <th>Circuit Depth</th>\n",
       "      <th>NISQ Uygunluğu</th>\n",
       "      <th>En İyi Kullanım</th>\n",
       "      <th>Qiskit Desteği</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Basis</td>\n",
       "      <td>N</td>\n",
       "      <td>O(1)</td>\n",
       "      <td>Yüksek</td>\n",
       "      <td>Binary veri, toy örnekler</td>\n",
       "      <td>Manuel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Amplitude</td>\n",
       "      <td>⌈log₂ N⌉</td>\n",
       "      <td>O(N) ~ yüksek</td>\n",
       "      <td>Düşük-Orta</td>\n",
       "      <td>HHL, yüksek boyut, görüntü</td>\n",
       "      <td>initialize()</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Angle</td>\n",
       "      <td>N</td>\n",
       "      <td>O(1)</td>\n",
       "      <td>Çok Yüksek</td>\n",
       "      <td>VQC, QNN, geospatial</td>\n",
       "      <td>Manuel / FeatureMap</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Dense Angle</td>\n",
       "      <td>⌈N/2⌉</td>\n",
       "      <td>O(1)</td>\n",
       "      <td>Yüksek</td>\n",
       "      <td>Qubit tasarrufu</td>\n",
       "      <td>Manuel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>ZZFeatureMap</td>\n",
       "      <td>N</td>\n",
       "      <td>O(reps × N)</td>\n",
       "      <td>Yüksek</td>\n",
       "      <td>QSVM, kernel yöntemleri</td>\n",
       "      <td>ZZFeatureMap</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f331002d-52a4-4cdf-8931-55b4dfd9b251')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-f331002d-52a4-4cdf-8931-55b4dfd9b251 button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-f331002d-52a4-4cdf-8931-55b4dfd9b251');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "summary": "{\n  \"name\": \"encoding_comparison_table()\",\n  \"rows\": 5,\n  \"fields\": [\n    {\n      \"column\": \"Encoding\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"Amplitude\",\n          \"ZZFeatureMap\",\n          \"Angle\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Qubit (N \\u00f6zellik)\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"N\",\n          \"\\u2308log\\u2082 N\\u2309\",\n          \"\\u2308N/2\\u2309\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Circuit Depth\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"O(1)\",\n          \"O(N) ~ y\\u00fcksek\",\n          \"O(reps \\u00d7 N)\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"NISQ Uygunlu\\u011fu\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"Y\\u00fcksek\",\n          \"D\\u00fc\\u015f\\u00fck-Orta\",\n          \"\\u00c7ok Y\\u00fcksek\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"En \\u0130yi Kullan\\u0131m\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"HHL, y\\u00fcksek boyut, g\\u00f6r\\u00fcnt\\u00fc\",\n          \"QSVM, kernel y\\u00f6ntemleri\",\n          \"VQC, QNN, geospatial\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Qiskit Deste\\u011fi\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"initialize()\",\n          \"ZZFeatureMap\",\n          \"Manuel\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
      }
     },
     "metadata": {}
    }
   ],
   "execution_count": 9,
   "id": "1xRp6MEd2nkE"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "TxLyHkTd2nkF"
   },
   "source": "## 9. Kendi CSV / Excel Dosyanızı Yükleyin (Colab)\n\nGoogle Colab'da çalışıyorsanız aşağıdaki hücreyi kullanarak kendi dosyanızı yükleyebilirsiniz.",
   "id": "TxLyHkTd2nkF"
  },
  {
   "cell_type": "code",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000
    },
    "id": "bc5UuP8P2nkF",
    "executionInfo": {
     "status": "error",
     "timestamp": 1787224192293,
     "user_tz": -180,
     "elapsed": 12469,
     "user": {
      "displayName": "Joseph Volkan ÖZCAN",
      "userId": "11389530967736397480"
     }
    },
    "outputId": "50bce84e-1fb3-47ac-9178-703a4cd27139"
   },
   "source": "# Colab'da dosya yükleme\ntry:\n    from google.colab import files\n    print(\"CSV veya Excel dosyanızı seçin (iptal ederseniz örnek veriyle devam edilir):\")\n    uploaded = files.upload()\n\n    if uploaded:\n        filename = list(uploaded.keys())[0]\n        print(f\"\\nYüklenen dosya: {filename}\")\n\n        encoder_user = QuantumDataEncoder()\n        encoder_user.data_type = \"tabular\"\n\n        # Hassas sütunları belirtin (örnek)\n        # sensitive_user = [\"tc_kimlik\", \"email\"]  # kendi sütun adlarınızı yazın\n        sensitive_user = None  # yoksa None bırakın\n\n        X_user = encoder_user.load_data(\n            file_path=filename,\n            sensitive_cols=sensitive_user,\n            anonymize_method=\"hash_salt\"\n        )\n\n        qc_user = encoder_user.encode(\n            encoding=\"auto\",\n            algorithm=\"VQC\",\n            device=\"simulator\",\n            sample_idx=0,\n            reps=2\n        )\n    else:\n        print(\"Dosya yüklenmedi → yukarıdaki örnek senaryolarla devam edebilirsiniz.\")\nexcept ImportError:\n    print(\"Bu hücre sadece Google Colab'da çalışır.\")\n    print(\"Yerel Jupyter'da kendi dosya yolunuzu load_data(file_path=...) ile verin.\")",
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "CSV veya Excel dosyanızı seçin (iptal ederseniz örnek veriyle devam edilir):\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ],
      "text/html": [
       "\n",
       "     <input type=\"file\" id=\"files-60e02892-8e44-423c-9dc7-a97c61bfa709\" name=\"files[]\" multiple disabled\n",
       "        style=\"border:none\" />\n",
       "     <output id=\"result-60e02892-8e44-423c-9dc7-a97c61bfa709\">\n",
       "      Upload widget is only available when the cell has been executed in the\n",
       "      current browser session. Please rerun this cell to enable.\n",
       "      </output>\n",
       "      <script>// Copyright 2017 Google LLC\n",
       "//\n",
       "// Licensed under the Apache License, Version 2.0 (the \"License\");\n",
       "// you may not use this file except in compliance with the License.\n",
       "// You may obtain a copy of the License at\n",
       "//\n",
       "//      http://www.apache.org/licenses/LICENSE-2.0\n",
       "//\n",
       "// Unless required by applicable law or agreed to in writing, software\n",
       "// distributed under the License is distributed on an \"AS IS\" BASIS,\n",
       "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
       "// See the License for the specific language governing permissions and\n",
       "// limitations under the License.\n",
       "\n",
       "/**\n",
       " * @fileoverview Helpers for google.colab Python module.\n",
       " */\n",
       "(function(scope) {\n",
       "function span(text, styleAttributes = {}) {\n",
       "  const element = document.createElement('span');\n",
       "  element.textContent = text;\n",
       "  for (const key of Object.keys(styleAttributes)) {\n",
       "    element.style[key] = styleAttributes[key];\n",
       "  }\n",
       "  return element;\n",
       "}\n",
       "\n",
       "// Max number of bytes which will be uploaded at a time.\n",
       "const MAX_PAYLOAD_SIZE = 100 * 1024;\n",
       "\n",
       "function _uploadFiles(inputId, outputId) {\n",
       "  const steps = uploadFilesStep(inputId, outputId);\n",
       "  const outputElement = document.getElementById(outputId);\n",
       "  // Cache steps on the outputElement to make it available for the next call\n",
       "  // to uploadFilesContinue from Python.\n",
       "  outputElement.steps = steps;\n",
       "\n",
       "  return _uploadFilesContinue(outputId);\n",
       "}\n",
       "\n",
       "// This is roughly an async generator (not supported in the browser yet),\n",
       "// where there are multiple asynchronous steps and the Python side is going\n",
       "// to poll for completion of each step.\n",
       "// This uses a Promise to block the python side on completion of each step,\n",
       "// then passes the result of the previous step as the input to the next step.\n",
       "function _uploadFilesContinue(outputId) {\n",
       "  const outputElement = document.getElementById(outputId);\n",
       "  const steps = outputElement.steps;\n",
       "\n",
       "  const next = steps.next(outputElement.lastPromiseValue);\n",
       "  return Promise.resolve(next.value.promise).then((value) => {\n",
       "    // Cache the last promise value to make it available to the next\n",
       "    // step of the generator.\n",
       "    outputElement.lastPromiseValue = value;\n",
       "    return next.value.response;\n",
       "  });\n",
       "}\n",
       "\n",
       "/**\n",
       " * Generator function which is called between each async step of the upload\n",
       " * process.\n",
       " * @param {string} inputId Element ID of the input file picker element.\n",
       " * @param {string} outputId Element ID of the output display.\n",
       " * @return {!Iterable<!Object>} Iterable of next steps.\n",
       " */\n",
       "function* uploadFilesStep(inputId, outputId) {\n",
       "  const inputElement = document.getElementById(inputId);\n",
       "  inputElement.disabled = false;\n",
       "\n",
       "  const outputElement = document.getElementById(outputId);\n",
       "  outputElement.innerHTML = '';\n",
       "\n",
       "  const pickedPromise = new Promise((resolve) => {\n",
       "    inputElement.addEventListener('change', (e) => {\n",
       "      resolve(e.target.files);\n",
       "    });\n",
       "  });\n",
       "\n",
       "  const cancel = document.createElement('button');\n",
       "  inputElement.parentElement.appendChild(cancel);\n",
       "  cancel.textContent = 'Cancel upload';\n",
       "  const cancelPromise = new Promise((resolve) => {\n",
       "    cancel.onclick = () => {\n",
       "      resolve(null);\n",
       "    };\n",
       "  });\n",
       "\n",
       "  // Wait for the user to pick the files.\n",
       "  const files = yield {\n",
       "    promise: Promise.race([pickedPromise, cancelPromise]),\n",
       "    response: {\n",
       "      action: 'starting',\n",
       "    }\n",
       "  };\n",
       "\n",
       "  cancel.remove();\n",
       "\n",
       "  // Disable the input element since further picks are not allowed.\n",
       "  inputElement.disabled = true;\n",
       "\n",
       "  if (!files) {\n",
       "    return {\n",
       "      response: {\n",
       "        action: 'complete',\n",
       "      }\n",
       "    };\n",
       "  }\n",
       "\n",
       "  for (const file of files) {\n",
       "    const li = document.createElement('li');\n",
       "    li.append(span(file.name, {fontWeight: 'bold'}));\n",
       "    li.append(span(\n",
       "        `(${file.type || 'n/a'}) - ${file.size} bytes, ` +\n",
       "        `last modified: ${\n",
       "            file.lastModifiedDate ? file.lastModifiedDate.toLocaleDateString() :\n",
       "                                    'n/a'} - `));\n",
       "    const percent = span('0% done');\n",
       "    li.appendChild(percent);\n",
       "\n",
       "    outputElement.appendChild(li);\n",
       "\n",
       "    const fileDataPromise = new Promise((resolve) => {\n",
       "      const reader = new FileReader();\n",
       "      reader.onload = (e) => {\n",
       "        resolve(e.target.result);\n",
       "      };\n",
       "      reader.readAsArrayBuffer(file);\n",
       "    });\n",
       "    // Wait for the data to be ready.\n",
       "    let fileData = yield {\n",
       "      promise: fileDataPromise,\n",
       "      response: {\n",
       "        action: 'continue',\n",
       "      }\n",
       "    };\n",
       "\n",
       "    // Use a chunked sending to avoid message size limits. See b/62115660.\n",
       "    let position = 0;\n",
       "    do {\n",
       "      const length = Math.min(fileData.byteLength - position, MAX_PAYLOAD_SIZE);\n",
       "      const chunk = new Uint8Array(fileData, position, length);\n",
       "      position += length;\n",
       "\n",
       "      const base64 = btoa(String.fromCharCode.apply(null, chunk));\n",
       "      yield {\n",
       "        response: {\n",
       "          action: 'append',\n",
       "          file: file.name,\n",
       "          data: base64,\n",
       "        },\n",
       "      };\n",
       "\n",
       "      let percentDone = fileData.byteLength === 0 ?\n",
       "          100 :\n",
       "          Math.round((position / fileData.byteLength) * 100);\n",
       "      percent.textContent = `${percentDone}% done`;\n",
       "\n",
       "    } while (position < fileData.byteLength);\n",
       "  }\n",
       "\n",
       "  // All done.\n",
       "  yield {\n",
       "    response: {\n",
       "      action: 'complete',\n",
       "    }\n",
       "  };\n",
       "}\n",
       "\n",
       "scope.google = scope.google || {};\n",
       "scope.google.colab = scope.google.colab || {};\n",
       "scope.google.colab._files = {\n",
       "  _uploadFiles,\n",
       "  _uploadFilesContinue,\n",
       "};\n",
       "})(self);\n",
       "</script> "
      ]
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Saving Graniser Grup 17 Ağustos 2026 Dava Raporu.xlsx to Graniser Grup 17 Ağustos 2026 Dava Raporu.xlsx\n",
      "\n",
      "Yüklenen dosya: Graniser Grup 17 Ağustos 2026 Dava Raporu.xlsx\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 📊 Yüklenen Tabular Veri"
     },
     "metadata": {}
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "   #                                    Davacı/Alacaklı  \\\n",
       "0  1  VLV Endüstriyel Yangın Tesisat Mühendislik İnş...   \n",
       "1  2                                       Foçalı Palet   \n",
       "2  3                                       Foçalı Palet   \n",
       "3  4                                       Foçalı Palet   \n",
       "4  5                                       Foçalı Palet   \n",
       "\n",
       "                                    Davalı/Borçlu  \\\n",
       "0  Graniser Granit Seramik Sanayi ve Ticaret A.Ş.   \n",
       "1  Graniser Granit Seramik Sanayi ve Ticaret A.Ş.   \n",
       "2  Graniser Granit Seramik Sanayi ve Ticaret A.Ş.   \n",
       "3  Graniser Granit Seramik Sanayi ve Ticaret A.Ş.   \n",
       "4  Graniser Granit Seramik Sanayi ve Ticaret A.Ş.   \n",
       "\n",
       "                        Mahkeme/İcra         Dosya No  \\\n",
       "0   İzmir3. Asliye Ticaret Mahkemesi    2025/776 Esas   \n",
       "1             İzmir 12. İcra Dairesi  2025/8555 Esas    \n",
       "2             İzmir 12. İcra Dairesi  2025/9223 Esas    \n",
       "3  İzmir 7. Asliye ticaret Mahkemesi   2025/1120 Esas   \n",
       "4  İzmir 5. Asliye Ticaret Mahkemesi    2026/329 Esas   \n",
       "\n",
       "                                                Konu  \\\n",
       "0                                    İtirazın iptali   \n",
       "1                                Örnek 7 İcra Takibi   \n",
       "2                                Örnek 7 İcra Takibi   \n",
       "3  İzmir 12. İcra Dairesinin 2025/8555 Esas sayıl...   \n",
       "4  İzmir 12. İcra Dairesinin 2025/9223 Esas sayıl...   \n",
       "\n",
       "                             Dava Değeri             Tutar  PB  \\\n",
       "0         805850,39 (Takip çıkışı tutar)         805850.39  TL   \n",
       "1      5.569.810,37 (Takip çıkışı tutar)        5569810.37  TL   \n",
       "2  ı 1.269.065,81 T (Takip çıkışı tutar)  ı 1.269.065,81 T  TL   \n",
       "3      5.569.810,37 (Takip çıkışı tutar)        5569810.37  TL   \n",
       "4      1.269.065,81 (Takip çıkışı tutar)        1269065.81  TL   \n",
       "\n",
       "                                           Son Durum  Avukat Görüşü  \\\n",
       "0       Bir sonraki duruşma 13.01.2027 tarihindedir.              0   \n",
       "1  İcra takibine itiraz edilmiş olup takip durdur...              0   \n",
       "2  İcra takibine itiraz edilmiş olup takip durdur...              0   \n",
       "3                    Dosya istinaf incelemesindedir.              0   \n",
       "4    Ön inceleme duruşması 10.11.2026 tarihindedir.               0   \n",
       "\n",
       "  Ayrılacak Karşılık  Notlar  \\\n",
       "0          805850.39     NaN   \n",
       "1         5569810.37     NaN   \n",
       "2     1.269.065,81 T     NaN   \n",
       "3         5569810.37     NaN   \n",
       "4         1269065.81     NaN   \n",
       "\n",
       "                                         Dava Detayı  \n",
       "0  Alacaklı tarafından fatura alacaklarına istina...  \n",
       "1  Alacaklı tarafından cari hesap alacaklarına is...  \n",
       "2  Alacaklı tarafından cari hesap alacaklarına is...  \n",
       "3  Alacaklı tarafından cari hesap alacaklarına is...  \n",
       "4  Alacaklı tarafından cari hesap alacaklarına is...  "
      ],
      "text/html": [
       "\n",
       "  <div id=\"df-e744120e-16c1-4000-bd61-70a9366f8695\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>#</th>\n",
       "      <th>Davacı/Alacaklı</th>\n",
       "      <th>Davalı/Borçlu</th>\n",
       "      <th>Mahkeme/İcra</th>\n",
       "      <th>Dosya No</th>\n",
       "      <th>Konu</th>\n",
       "      <th>Dava Değeri</th>\n",
       "      <th>Tutar</th>\n",
       "      <th>PB</th>\n",
       "      <th>Son Durum</th>\n",
       "      <th>Avukat Görüşü</th>\n",
       "      <th>Ayrılacak Karşılık</th>\n",
       "      <th>Notlar</th>\n",
       "      <th>Dava Detayı</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>VLV Endüstriyel Yangın Tesisat Mühendislik İnş...</td>\n",
       "      <td>Graniser Granit Seramik Sanayi ve Ticaret A.Ş.</td>\n",
       "      <td>İzmir3. Asliye Ticaret Mahkemesi</td>\n",
       "      <td>2025/776 Esas</td>\n",
       "      <td>İtirazın iptali</td>\n",
       "      <td>805850,39 (Takip çıkışı tutar)</td>\n",
       "      <td>805850.39</td>\n",
       "      <td>TL</td>\n",
       "      <td>Bir sonraki duruşma 13.01.2027 tarihindedir.</td>\n",
       "      <td>0</td>\n",
       "      <td>805850.39</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Alacaklı tarafından fatura alacaklarına istina...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>Foçalı Palet</td>\n",
       "      <td>Graniser Granit Seramik Sanayi ve Ticaret A.Ş.</td>\n",
       "      <td>İzmir 12. İcra Dairesi</td>\n",
       "      <td>2025/8555 Esas</td>\n",
       "      <td>Örnek 7 İcra Takibi</td>\n",
       "      <td>5.569.810,37 (Takip çıkışı tutar)</td>\n",
       "      <td>5569810.37</td>\n",
       "      <td>TL</td>\n",
       "      <td>İcra takibine itiraz edilmiş olup takip durdur...</td>\n",
       "      <td>0</td>\n",
       "      <td>5569810.37</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Alacaklı tarafından cari hesap alacaklarına is...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>Foçalı Palet</td>\n",
       "      <td>Graniser Granit Seramik Sanayi ve Ticaret A.Ş.</td>\n",
       "      <td>İzmir 12. İcra Dairesi</td>\n",
       "      <td>2025/9223 Esas</td>\n",
       "      <td>Örnek 7 İcra Takibi</td>\n",
       "      <td>ı 1.269.065,81 T (Takip çıkışı tutar)</td>\n",
       "      <td>ı 1.269.065,81 T</td>\n",
       "      <td>TL</td>\n",
       "      <td>İcra takibine itiraz edilmiş olup takip durdur...</td>\n",
       "      <td>0</td>\n",
       "      <td>1.269.065,81 T</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Alacaklı tarafından cari hesap alacaklarına is...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>Foçalı Palet</td>\n",
       "      <td>Graniser Granit Seramik Sanayi ve Ticaret A.Ş.</td>\n",
       "      <td>İzmir 7. Asliye ticaret Mahkemesi</td>\n",
       "      <td>2025/1120 Esas</td>\n",
       "      <td>İzmir 12. İcra Dairesinin 2025/8555 Esas sayıl...</td>\n",
       "      <td>5.569.810,37 (Takip çıkışı tutar)</td>\n",
       "      <td>5569810.37</td>\n",
       "      <td>TL</td>\n",
       "      <td>Dosya istinaf incelemesindedir.</td>\n",
       "      <td>0</td>\n",
       "      <td>5569810.37</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Alacaklı tarafından cari hesap alacaklarına is...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>Foçalı Palet</td>\n",
       "      <td>Graniser Granit Seramik Sanayi ve Ticaret A.Ş.</td>\n",
       "      <td>İzmir 5. Asliye Ticaret Mahkemesi</td>\n",
       "      <td>2026/329 Esas</td>\n",
       "      <td>İzmir 12. İcra Dairesinin 2025/9223 Esas sayıl...</td>\n",
       "      <td>1.269.065,81 (Takip çıkışı tutar)</td>\n",
       "      <td>1269065.81</td>\n",
       "      <td>TL</td>\n",
       "      <td>Ön inceleme duruşması 10.11.2026 tarihindedir.</td>\n",
       "      <td>0</td>\n",
       "      <td>1269065.81</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Alacaklı tarafından cari hesap alacaklarına is...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "\n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-e744120e-16c1-4000-bd61-70a9366f8695')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "\n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "\n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-e744120e-16c1-4000-bd61-70a9366f8695 button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-e744120e-16c1-4000-bd61-70a9366f8695');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "\n",
       "\n",
       "    </div>\n",
       "  </div>\n"
      ],
      "application/vnd.google.colaboratory.intrinsic+json": {
       "type": "dataframe",
       "summary": "{\n  \"name\": \"    print(\\\"Yerel Jupyter'da kendi dosya yolunuzu load_data(file_path=\",\n  \"rows\": 5,\n  \"fields\": [\n    {\n      \"column\": \"#\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 1,\n        \"min\": 1,\n        \"max\": 5,\n        \"num_unique_values\": 5,\n        \"samples\": [\n          2,\n          5,\n          3\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Davac\\u0131/Alacakl\\u0131\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"Fo\\u00e7al\\u0131 Palet\",\n          \"VLV End\\u00fcstriyel Yang\\u0131n Tesisat M\\u00fchendislik \\u0130n\\u015faat Otomasyon \\u0130thalat \\u0130hracat Sanayi ve Ticaret Limited \\u015eirketi \"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Daval\\u0131/Bor\\u00e7lu\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"Graniser Granit Seramik Sanayi ve Ticaret A.\\u015e.\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Mahkeme/\\u0130cra\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"\\u0130zmir 12. \\u0130cra Dairesi\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Dosya No\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 5,\n        \"samples\": [\n          \"2025/8555 Esas \"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Konu\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"\\u00d6rnek 7 \\u0130cra Takibi\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Dava De\\u011feri\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"5.569.810,37 (Takip \\u00e7\\u0131k\\u0131\\u015f\\u0131 tutar)\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Tutar\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          5569810.37\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"PB\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"TL\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Son Durum\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"\\u0130cra takibine itiraz edilmi\\u015f olup takip durdurulmu\\u015ftur.\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Avukat G\\u00f6r\\u00fc\\u015f\\u00fc\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": 0,\n        \"min\": 0,\n        \"max\": 0,\n        \"num_unique_values\": 1,\n        \"samples\": [\n          0\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Ayr\\u0131lacak Kar\\u015f\\u0131l\\u0131k\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          5569810.37\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Notlar\",\n      \"properties\": {\n        \"dtype\": \"number\",\n        \"std\": null,\n        \"min\": null,\n        \"max\": null,\n        \"num_unique_values\": 0,\n        \"samples\": [],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"Dava Detay\\u0131\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 4,\n        \"samples\": [],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}"
      }
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "✅ Tabular veri hazır: 6 örnek, 3 özellik\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🎯 Önerilen Encoding: **ZZ_FEATURE_MAP**"
     },
     "metadata": {}
    },
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "Tabular + VQC/QSVM → ZZFeatureMap (entanglement + kernel için ideal)\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ],
      "text/markdown": "### 🔧 Uygulanan Encoding: **ZZ_FEATURE_MAP**"
     },
     "metadata": {}
    },
    {
     "output_type": "error",
     "ename": "RuntimeError",
     "evalue": "Binding to NaN.",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mRuntimeError\u001b[0m                              Traceback (most recent call last)",
      "\u001b[0;32m/tmp/ipykernel_1936/1536692266.py\u001b[0m in \u001b[0;36m<cell line: 0>\u001b[0;34m()\u001b[0m\n\u001b[1;32m     22\u001b[0m         )\n\u001b[1;32m     23\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 24\u001b[0;31m         qc_user = encoder_user.encode(\n\u001b[0m\u001b[1;32m     25\u001b[0m             \u001b[0mencoding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"auto\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     26\u001b[0m             \u001b[0malgorithm\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"VQC\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/tmp/ipykernel_1936/805529563.py\u001b[0m in \u001b[0;36mencode\u001b[0;34m(self, encoding, algorithm, device, sample_idx, **kwargs)\u001b[0m\n\u001b[1;32m    210\u001b[0m             \u001b[0mqc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mencode_angle\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msample_idx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrotation\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"rotation\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"ry\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    211\u001b[0m         \u001b[0;32melif\u001b[0m \u001b[0mencoding\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"zz_feature_map\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"zz\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 212\u001b[0;31m             \u001b[0mqc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mencode_zz_feature_map\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msample_idx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    213\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    214\u001b[0m             \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"Desteklenmeyen encoding: {encoding}\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/tmp/ipykernel_1936/805529563.py\u001b[0m in \u001b[0;36mencode_zz_feature_map\u001b[0;34m(self, sample_idx, reps, entanglement)\u001b[0m\n\u001b[1;32m    192\u001b[0m         \u001b[0mparams\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0msample_idx\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    193\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mparams\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mfm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnum_parameters\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 194\u001b[0;31m             \u001b[0mqc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0massign_parameters\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mparams\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    195\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    196\u001b[0m             \u001b[0;31m# Parametre sayısı uyuşmazsa sadece şablonu döndür\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/qiskit/circuit/library/n_local/n_local.py\u001b[0m in \u001b[0;36massign_parameters\u001b[0;34m(self, parameters, inplace, **kwargs)\u001b[0m\n\u001b[1;32m   1073\u001b[0m             \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_build\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1074\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1075\u001b[0;31m         \u001b[0;32mreturn\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0massign_parameters\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mparameters\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minplace\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0minplace\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1076\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1077\u001b[0m     def _parameterize_block(\n",
      "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/qiskit/circuit/quantumcircuit.py\u001b[0m in \u001b[0;36massign_parameters\u001b[0;34m(self, parameters, inplace, flat_input, strict)\u001b[0m\n\u001b[1;32m   5070\u001b[0m             \u001b[0mtarget\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0massign_parameters_mapping\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mraw_mapping\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   5071\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 5072\u001b[0;31m             \u001b[0mtarget\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0massign_parameters_iterable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mparameters\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   5073\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   5074\u001b[0m         \u001b[0;32mreturn\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0minplace\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0mtarget\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mRuntimeError\u001b[0m: Binding to NaN."
     ]
    }
   ],
   "execution_count": 10,
   "id": "bc5UuP8P2nkF"
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "FG5cUOz92nkG"
   },
   "source": "---\n\n## Özet Akış (Öğrenciler İçin)\n\n| Adım | Ne olur? |\n|------|----------|\n| 1 | **Veri tipi sorulur** → tabular / image / geospatial |\n| 2 | Veri yüklenir |\n| 3 | **Tabular ise** → hassas sütunlar belirtilir → **anonymisation** uygulanır |\n| 4 | Veri tipine + algoritmaya + cihaza göre **encoding otomatik seçilir** |\n| 5 | Qiskit circuit üretilir ve çizilir |\n| 6 | İstenirse **deanonymisation** ile orijinal veri geri getirilir |\n\n### GDPR/KVKK Notu (Eğitim)\n\n- Bu notebook’taki anonymisation **geri dönüşümlüdür** (mapping saklanır) → eğitim ve test için uygundur.\n- Gerçek KVKK/GDPR uyumlu sistemlerde:\n  - k-anonymity, l-diversity, differential privacy,\n  - irreversible hashing / tokenization,\n  - veri minimizasyonu  \n  tercih edilir.\n- Quantum encoding **anonymize edilmiş** veri üzerinde yapılır; böylece hassas bilgi Hilbert uzayına doğrudan girmez.\n\n---\n\n**Hazırlayan:** QML Eğitim Araçları  \n**Tarih:** 2026  \n**Lisans:** Eğitim amaçlı serbest kullanım",
   "id": "FG5cUOz92nkG"
  }
 ]
}