Microbial maturity index prediction.
Calculates a "microbial maturity" index from a regression model trained on
feature data to predict a given continuous metadata column, e.g., to
predict age as a function of microbiota composition. The model is trained
on a subset of control group samples, then predicts the column value for
all samples. This visualization computes maturity index z-scores to compare
relative "maturity" between each group, as described in
doi:10.1038/nature13421. This method can be used to predict between-group
differences in relative trajectory across any type of continuous metadata
gradient, e.g., intestinal microbiome development by age, microbial
succession during wine fermentation, or microbial community differences
along environmental gradients, as a function of two or more different
"treatment" groups.
Parameters
- table : FeatureTable[Frequency]
- Feature table containing all features that should be used for target
prediction.
- metadata : Metadata
- state_column : Str
- Numeric metadata column containing sampling time (state) data to use as
prediction target.
- group_by : Str
- Categorical metadata column to use for plotting and significance
testing between main treatment groups.
- control : Str
- Value of group_by to use as control group. The regression model will be
trained using only control group data, and the maturity scores of other
groups consequently will be assessed relative to this group.
- individual_id_column : Str, optional
- Optional metadata column containing IDs for individual subjects. Adds
individual subject (spaghetti) vectors to volatility charts if a column
name is provided.
- estimator : Str % Choices('RandomForestRegressor', 'ExtraTreesRegressor', 'GradientBoostingRegressor', 'AdaBoostRegressor', 'ElasticNet', 'Ridge', 'Lasso', 'KNeighborsRegressor', 'LinearSVR', 'SVR'), optional
- Regression model to use for prediction.
- n_estimators : Int % Range(1, None), optional
- Number of trees to grow for estimation. More trees will improve
predictive accuracy up to a threshold level, but will also increase
time and memory requirements. This parameter only affects ensemble
estimators, such as Random Forest, AdaBoost, ExtraTrees, and
GradientBoosting.
- test_size : Float % Range(0.0, 1.0, inclusive_start=False), optional
- Fraction of input samples to exclude from training set and use for
classifier testing.
- step : Float % Range(0.0, 1.0, inclusive_start=False), optional
- If optimize_feature_selection is True, step is the percentage of
features to remove at each iteration.
- cv : Int % Range(1, None), optional
- Number of k-fold cross-validations to perform.
- random_state : Int, optional
- Seed used by random number generator.
- parameter_tuning : Bool, optional
- Automatically tune hyperparameters using random grid search.
- optimize_feature_selection : Bool, optional
- Automatically optimize input feature selection using recursive feature
elimination.
- stratify : Bool, optional
- Evenly stratify training and test data among metadata categories. If
True, all values in column must match at least two samples.
- missing_samples : Str % Choices('error', 'ignore'), optional
- How to handle missing samples in metadata. "error" will fail if missing
samples are detected. "ignore" will cause the feature table and
metadata to be filtered, so that only samples found in both files are
retained.
- feature_count : Int % Range(0, None), optional
- Filter feature table to include top N most important features. Set to
zero to include all features.
Returns
- sample_estimator : SampleEstimator[Regressor]
- Trained sample estimator.
- feature_importance : FeatureData[Importance]
- Importance of each input feature to model accuracy.
- predictions : SampleData[RegressorPredictions]
- Predicted target values for each input sample.
- model_summary : Visualization
- Summarized parameter and (if enabled) feature selection information for
the trained estimator.
- accuracy_results : Visualization
- Accuracy results visualization.
- maz_scores : SampleData[RegressorPredictions]
- Microbiota-for-age z-score predictions.
- clustermap : Visualization
- Heatmap of important feature abundance at each time point in each
group.
- volatility_plots : Visualization
- Interactive volatility plots of MAZ and maturity scores, target
(column) predictions, and the sample metadata.