This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import roc_curve, auc | |
from sklearn.datasets import make_classification | |
from sklearn.linear_model import LogisticRegression | |
# Generate a synthetic dataset for classification | |
X, y = make_classification(n_samples=1000, n_classes=2, n_features=20, random_state=42) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import KFold | |
from collections import Counter | |
def euclidean_distance(x1, x2): | |
return np.sqrt(np.sum((x1 - x2)**2)) | |
def manhattan_distance(x1, x2): | |
return np.sum(np.abs(x1 - x2)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.