Skip to content
Snippets Groups Projects
Commit c1572fe9 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent e8395751
Branches
No related tags found
No related merge requests found
......@@ -50,13 +50,13 @@ def plot_confusion_matrix(cm, classes,
plt.xlabel('Predicted label')
def get_csv_as_dataframe(csv_file, reduce_frac=None):
def get_csv_as_dataframe(csv_file, reduce_frac=None, random_state=42):
icing_df = pd.read_csv(csv_file)
# Random selection of reduce_frac of the rows
if reduce_frac is not None:
icing_df = icing_df.sample(frac=reduce_frac)
print(icing_df.describe())
print(icing_df.shape)
icing_df = icing_df.sample(axis=0, frac=reduce_frac, random_state=random_state)
return icing_df
......@@ -72,9 +72,8 @@ def get_feature_target_data(data_frame, standardize=True):
# Remove rows with NaN values
# icing_df = icing_df.dropna()
print('num obs, features: ', icing_df.shape)
x = np.asarray(icing_df[params])
print('num obs, features: ', x.shape)
if standardize:
x = preprocessing.StandardScaler().fit(x).transform(x)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment