- Define function with name
csv_to_dataframe
which should acceptfilepath
as a parameter. - Function should return a dataframe.
- As we require a dataframe, type of return variable should be pandas dataframe.
- In case if we pass
filepath
which does not exist, function should raise FileNotFoundError.
- Define function with name
dtype_category
which should acceptdataframe
andlist of columns
as parameters. - Function should return a dataframe with type of given columns changed to "category".
- As we require a dataframe, type of return variable should be
pandas dataframe
. - In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
plot_corr
which should acceptdataframe
as parameter. - Function should return plots of numeric variables.
- As we require plot, type of return variable should be matplotlib object.
- In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
correlation_list
which should acceptdataframe
as parameter. - Function should return list of tuples containing the correlation in decreasing value and name of the features.
- As we require list of tuples, type of return variable should be list.
- In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
multi_power
which should acceptdataframe
,column_list
(list of columns to be transformed),power_list
(list of powers required in number) as parameter. - Function should return transformed dataframe containing new columns.
- As we require a transformed dataframe, type of return variable should be pandas DataFrame.
- In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
log
which should acceptdataframe
,column_list
(list of columns to be transformed)as parameter. - Function should return transformed dataframe containing new columns.
- As we require a transformed dataframe, type of return variable should be pandas DataFrame.
- In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
loglog
which should acceptdataframe
,column_list
(list of columns to be transformed) as parameter. - Function should return transformed dataframe containing new columns.
- As we require a transformed dataframe, type of return variable should be pandas DataFrame.
- In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
remove_inf_values
which should acceptdataframe
,column
(name of column as string for which infinite values are to be removed) as parameter and another function with nameremove_nan_values
which should acceptdataframe
( for removing all nan values) as parameter - Function should return transformed dataframe with infinte and nan values removed.
- As we require a transformed dataframe, type of return variable should be pandas DataFrame.
- In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
best_k_features
which should acceptdataframe
,predictors
(list of predictor variables),target
(target variable as string),k
(number as int for number of best features required) as parameter. - Function should return a list of k most informative feature.
- As we require a list, type of return variable should be list.
- In case if we pass column name which does not exist, function should raise KeyError
- Define function with name
rf_rfe
which should acceptdataframe
,predictors
(list of predictor variables),target
(target variable as string) as parameter. - Function should return a list of features which are retained.
- As we require a list, type of return variable should be list.
- In case if we pass column name which does not exist, function should raise KeyError