Knowing "which feature really matters for the prediction" is central to understanding a model and pruning useless features. A random forest is an ensemble of decision trees, and it also reports a per-feature importance. Complete rank_features(X_train, y_train, X_test, y_test, feature_names). X_train, y_train training features and labels. X_test, y_test a held-out set of features and labels. feature_names the name of each column (feature). Train a random forest and return the feature names as a list in order of importance (most important first). Example ['income', 'age', 'zipcode'] means income is the most important.
This challenge asks you to complete a function that trains scikit-learn's random forest and returns the feature names as a list ordered by importance, most important first. It takes training and held-out feature sets with their labels plus the column names, and the returned list must contain every name exactly once. It practices reading which features matter most to a model's prediction.
Knowing which feature really matters for a prediction is central to understanding a model and pruning features that don't pull their weight. A random forest is an ensemble of decision trees, and it can report a per-feature importance. This problem produces a feature ranking with scikit-learn and verifies it against data you control rather than trusting a plausible-looking order.