Print some more messages.

rapids
junos 2021-08-21 19:03:44 +02:00
parent 11381d6447
commit 24c4bef7e2
1 changed files with 7 additions and 2 deletions

View File

@ -34,6 +34,7 @@ class SensorFeatures:
self.df_calls = pd.DataFrame() self.df_calls = pd.DataFrame()
self.df_sms = pd.DataFrame() self.df_sms = pd.DataFrame()
self.df_calls_sms = pd.DataFrame() self.df_calls_sms = pd.DataFrame()
print("SensorFeatures initialized.")
def set_sensor_data(self): def set_sensor_data(self):
if "proximity" in self.data_types: if "proximity" in self.data_types:
@ -124,6 +125,7 @@ class Labels:
self.df_esm_clean = pd.DataFrame() self.df_esm_clean = pd.DataFrame()
self.df_esm_means = pd.DataFrame() self.df_esm_means = pd.DataFrame()
print("Labels initialized.")
def set_labels(self): def set_labels(self):
self.df_esm = esm.get_esm_data(self.participants_usernames) self.df_esm = esm.get_esm_data(self.participants_usernames)
@ -198,10 +200,13 @@ class ModelValidation:
def cross_validate(self): def cross_validate(self):
if self.model is None: if self.model is None:
raise TypeError( raise TypeError(
"Please set self.model first, e.g. self.model = sklearn.linear_model.LinearRegression()" "Please, specify a machine learning model first, by setting the .model attribute. "
"E.g. self.model = sklearn.linear_model.LinearRegression()"
) )
if self.cv is None: if self.cv is None:
raise TypeError("Please use set_cv_method() first.") raise TypeError(
"Please, specify a cross validation method first, by using set_cv_method() first."
)
if self.X.isna().any().any() or self.y.isna().any().any(): if self.X.isna().any().any() or self.y.isna().any().any():
raise ValueError( raise ValueError(
"NaNs were found in either X or y. Please, check your data before continuing." "NaNs were found in either X or y. Please, check your data before continuing."