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

snapshot...

parent 480bf3e2
No related branches found
No related tags found
No related merge requests found
...@@ -81,14 +81,17 @@ def get_csv_as_dataframe(csv_file, reduce_frac=None, random_state=42): ...@@ -81,14 +81,17 @@ def get_csv_as_dataframe(csv_file, reduce_frac=None, random_state=42):
def get_feature_target_data(data_frame, standardize=True): def get_feature_target_data(data_frame, standardize=True):
icing_df = data_frame icing_df = data_frame
# The independent variables (features) we want to use: # Remove these, more than half seem to be NaN
params = ['cld_temp_acha', 'conv_cloud_fraction', 'supercooled_cloud_fraction', 'cld_reff_dcomp',
'cld_opd_dcomp', 'iwc_dcomp', 'cld_cwp_dcomp']
# Remove this column
icing_df = icing_df.drop('lwc_dcomp', axis=1) icing_df = icing_df.drop('lwc_dcomp', axis=1)
# Remove this column icing_df = icing_df.drop('iwc_dcomp', axis=1)
# Remove this column for now.
icing_df = icing_df.drop('cld_geo_thick', axis=1) icing_df = icing_df.drop('cld_geo_thick', axis=1)
# The independent variables (features) we want to use:
params = ['cld_temp_acha', 'conv_cloud_fraction', 'supercooled_cloud_fraction', 'cld_reff_dcomp',
'cld_opd_dcomp', 'cld_cwp_dcomp']
# Remove rows with NaN values # Remove rows with NaN values
# icing_df = icing_df.dropna() # icing_df = icing_df.dropna()
...@@ -97,7 +100,7 @@ def get_feature_target_data(data_frame, standardize=True): ...@@ -97,7 +100,7 @@ def get_feature_target_data(data_frame, standardize=True):
if standardize: if standardize:
x = preprocessing.StandardScaler().fit(x).transform(x) x = preprocessing.StandardScaler().fit(x).transform(x)
# The dependent variable (target) ------------------------------ # The dependent variable (target) --------------------------------------------
y = np.asarray(icing_df['icing_intensity']) y = np.asarray(icing_df['icing_intensity'])
y = np.where(y == -1, 0, y) y = np.where(y == -1, 0, y)
y = np.where(y >= 1, 1, y) y = np.where(y >= 1, 1, y)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment