# Prediction of Eudaimonic and Hedonic Orientation of Movie Watchers
## 3 Methods and Materials
### Machine-Learning Workflow
\begin{table}
\begin{tabular}{c c l l} \hline \hline
**Model** & **Scaled** & **Parameters** & **Tested Values** \\ \hline Ridge & ✓ & alpha (regularization parameter) & 0, 0.0001, 0.001, 0.01, 0.1, 1, 5, 10 \\ \hline Lasso & ✓ & alpha (regularization parameter) & 0, 0.0001, 0.001, 0.1, 1, 5, 10 \\ \hline \multirow{4}{*}{SVR} & \multirow{4}{*}{✓} & Kernel & linear, rbf, poly \\ \cline{3-4}  & & C & 0.001, 0.01, 0.1, 1.0, 10, 100 \\ \cline{3-4}  & & gamma & scale, auto \\ \cline{3-4}  & & epsilon & 0.001, 0.01, 0.1, 0.2, 0.5, 0.3, 1.0, 2.0, 4.0 \\ \hline \multirow{4}{*}{KNeighborsRegressor} & \multirow{4}{*}{✓} & n\_neighbors & 3, 5, 7, 9 \\ \cline{3-4}  & & weights & uniform, distance \\ \cline{3-4}  & & algorithm & ball\_tree, kd\_tree, brute \\ \cline{3-4}  & & p & 1, 2 \\ \hline \multirow{4}{*}{DecisionTreeRegressor} & \multirow{4}{*}{X} & criterion & mae, mse \\ \cline{3-4}  & & splitter & best, random \\ \cline{3-4}  & & max\_depth & 1, 3, 5, 7, 9, 11, 12 \\ \cline{3-4}  & & min\_weight\_fraction\_leaf & 0.1, 0.2, 0.3, 0.4, 0.5 \\ \cline{3-4}  & & max\_features & auto, log2, sqrt, None \\ \cline{3-4}  & & max\_leaf\_nodes & None, 10, 20, 30, 40, 50, 60, 70, 80, 90 \\ \hline \multirow{4}{*}{RandomForestRegressor} & \multirow{4}{*}{X} & n\_estimators & 1, 3, 5, 7, 9, 11, 13, 15, 17, 20 \\ \cline{3-4}  & & max\_features & auto, sqrt \\ \cline{3-4}  & & max\_depth & 1, 3, 5, 7, 9, 11, 13, 15, 17, 20 \\ \cline{3-4}  & & min\_samples\_split & 2, 3, 4, 5, 10 \\ \cline{3-4}  & & min\_samples\_leaf & 1, 2, 4 \\ \cline{3-4}  & & bootstrap & True, False \\ \hline \multirow{4}{*}{XGBRegressor} & \multirow{4}{*}{X} & max\_depth & 3, 4, 5, 6, 7, 8, 9, 10, 11 \\ \cline{3-4}  & & min\_child\_weight & 1, 2, 3, 4, 5, 6, 7 \\ \cline{3-4}  & & eta & 0.001, 0.01, 0.1, 0.2, 0.5, 0.3, 1 \\ \cline{3-4}  & & subsample & 0.7, 0.8, 0.9, 1.0 \\ \cline{3-4}  & & colsample\_bytree & 0.7, 0.8, 0.9, 1.0 \\ \cline{3-4}  & & objective & reg:squarederror \\ \hline \hline \end{tabular}
\end{table} 
Table 2: ML models and hyperparameters (regression problem). Except for XGBRegressor, Scikit-learn was used to implement all models ([[https://scikit-learn.org/stable/](https://scikit-learn.org/stable/)]([https://scikit-learn.org/stable/](https://scikit-learn.org/stable/)) accessed on 15 September 2022). Python’s xgboost library was used to implement XGBRegressor. ([[https://xgboost.readthedocs.io/en/stable/parameter.html](https://xgboost.readthedocs.io/en/stable/parameter.html)]([https://xgboost.readthedocs.io/en/stable/parameter.html](https://xgboost.readthedocs.io/en/stable/parameter.html)) accessed on 15 September 2022). For training the model, we used a nested K fold cross-validation approach in which we could optimize the hyperparameters of the model. Different numbers of folds were used for outer cross-validation (where we evaluated the dataset) and inner cross-validation (where we tuned parameters on the evaluation sets). Feature selection was made by both manual and automatic methods. Manual feature selection was performed in the initial steps by limiting the features to the list of desired features. We also performed the automated feature selection by feeding the varied number of features (k parameter of SelectKBest class) as a hyperparameter in the pipeline (referred to as automated feature selection in Figure 2). Automatic feature selection was performed using SelectKBest class from scikit-learn Library, in which mutual information between individual features and the target variable was used to decide on the final set with k features. For parameter k of SelectKBest, we used all integer numbers (\(n\)) in the range of:  
\[3\leq n\leq max(features)\]