Write a Python method using scikit learn that takes feature data and a list of features, then trains a Gaussian Mixture model using the selected features and returns the trained model. Feature data contains the input feature or features used to train the model. The list of features contains the names of the feature columns that should be used from the feature data.   Requirements: The method should accept feature data and a list of features as input parameters. The method should not modify the given feature data. (3 pts) The method should check that all given features exist in the feature data, and return None if they do not. (3 pts) The method should select only the given features from the feature data. (2 pts) The method should scale the selected feature data. (3 pts) The method should create and train a Gaussian Mixture model using the scaled feature data. (5 pts) The method should return the trained Gaussian Mixture model. (1 pt) No need to add a DocString for the method. You can call the method whatever you like.   Example: If the given feature data is: Age Income Spending_Score Visits 0 22 35000 65 4 1 35 62000 45 8 2 48 80000 30 6 3 29 52000 70 5 and the given list of features is: [“Age”, “Income”, “Spending_Score”] the method should do the proper checking to ensure all given features exist, select only the Age, Income, and Spending_Score columns without modifying the original data, scale the selected data, train a Gaussian Mixture model using the scaled data, and return the model.论述题

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

类似问题

For stock A, we have 𝛽 𝑖 = 0.70. Suppose the expected market risk premium next year is 9% and the risk-free rate is 3%. What is the expected return of this stock based on the CAPM? (Please answer in % and round to 2 decimal places. If the answer is 8.057%, then in the box, write 8.06)

Suppose a multifactor model has three factor risk premia: market = 6%, profitability = 3%, and investment = 2%. A stock has: 𝛽 𝑚 𝑎 𝑟 𝑘 𝑒 𝑡 = 1.1,                   𝛽 𝑝 𝑟 𝑜 𝑓 𝑖 𝑡 𝑎 𝑏 𝑖 𝑙 𝑖 𝑡 𝑦 = 0.5,                       𝛽 𝑖 𝑛 𝑣 𝑒 𝑠 𝑡 𝑚 𝑒 𝑛 𝑡  = -0.2, And the risk-free rate is 3%. What is the expected return? (Please answer in % and round to 2 decimal places. If the answer is 8.057%, then in the box, write 8.06)

 Suppose that the covariance between a stock and the market portfolio is 0.06 and that the standard deviation of the market portfolio is 0.30. Suppose also that the standard deviation of the stock’s returns is 0.55. Based on the CAPM, what is β of this stock? (Please answer as a number and round to 2 decimal places. If the answer is 0.768, then in the box, write 0.77)

 Suppose that the CAPM holds and that Stock A, the market portfolio, and the risk-free asset have the following characteristics. Asset Expected return Standard deviation Stock A 15% 40% Market portfolio 11% 25% Risk-free asset 3% 0% What is the β of Stock A? (Please answer as a number and round to 2 decimal places. If the answer is 0.768, then in the box, write 0.77)

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!