Skip to content

Commit

Permalink
Q1. Unit normalize in preprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
ipranjal committed Dec 2, 2023
1 parent 6bc29a5 commit 5744b94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
from joblib import dump,load
from sklearn import preprocessing

#read gigits
def read_digits():
Expand All @@ -17,7 +18,9 @@ def read_digits():
# We will define utils here :
def preprocess_data(data):
n_samples = len(data)

data = data.reshape((n_samples, -1))
data = preprocessing.normalize(data, norm='l2')
return data

# Split data into 50% train and 50% test subsets
Expand Down

0 comments on commit 5744b94

Please sign in to comment.