2

If your predictors have nothing to do with the outcome, you should not be able to build a model that works out-of-sample. This is a feature, not a bug, of machine learning. For instance, do you consider what time I set my alarm in the morning to be predictive whether or not you have cereal for breakfast? Features can, however, have just a small relationship ...


2

I believe you are looking to work along with the missing values in particular column(X) where column(W,Y,Z) have important values in these rows and can't discard or do imputation, especially for plotting them visually. Yes its possible, considering: When you only plan to plot other columns(W,Y,Z excluding column X) to view them visually When you only plan ...


1

Try: from sklearn.compose import ColumnTransformer from sklearn.preprocessing import OneHotEncoder ct = ColumnTransformer(transformers = [('encoder', OneHotEncoder(),[1,2])], remainder ='passthrough') X = np.array(ct.fit_transform(X)) Note that you are passing [1:2] as the list of indices to apply the transformation on the ColumnTransformer but it should be ...


1

No the cleanest solution but it works currentyear = 2021 df["Vals"] = df.apply(lambda x: x["column1"] if x["y1"] == currentyear else x["column2"] if x["y2"] == currentyear else x["column3"], axis = 1) Hope it helps


1

The default quantiles with quantile are 0%, 25%, 50%, 75%, 100%. This means that the quartiles Q1 and Q3 are the second and fourth value in the two vector you obtain. Since indexes start at 1 it means that you can obtain Q1 with ar_quantiles[2] and Q3 with ar_quantiles[4]. Currently you're using indexes 1 and 2 and that's certainly what causes the problem. [...


Only top voted, non community-wiki answers of a minimum length are eligible