The transformed vectors will have a zero mean and zero correlation. Since the pdf is Gaussian,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The transformed vectors will have a zero mean and zero correlation. Since the pdf is Gaussian, these variables will be independent. Pseudo code: # Stacking features to a matrix Data = np.matrix([x1.y1]) # 1. Compute the mean and covariance matrix # 2. Perform eigendecomposition of covariance matrix #3. Modify the code below to get uncorrelated and rotated features xnew # rprime = xnew = np.transpose(rprime[0.:]) ynew = np.transpose(rprime[1.:]) #- # Plotting fig4 = plt.figure() ax4 = fig4.add_subplot(1, 1, 1) plt.plot(xnew, ynew, 'x') plt.xlim([-6,6]) plt.ylim([-6,6]) Xnew = : UT (x − µ) ax4.set_title('Transformed Samples') ax4.set_aspect('equal') mu_rotated = np.array((np.matrix.mean(rprime,axis=0))) Sigma_rotated = np.cov(Data) 2. Feature Normalization/Whitening To do #2: Feature Normalization/Whitening Most machine learning algorithms work well when the input features are "normalized" (e.g independent and are zero mean). We will now look at a data whitening transformation, which will take the original features and spit out normalized feaures. Find the expression for the matrix A and vector b such that the transformed features Xnew = A(x-μ) are uncorrelated and indentically distributed with zero mean as in Figure 1. The A matrix can be obtained from the eigen decomposition of the covariance matrix Σ = UAUT as A = A-1/2 UT Pseudo Code: Data = np.matrix([x1.y1]) # Transformation # Modify the code below to get uncorrelated and uniformly distributed features -# rprime = xnew = np.transpose(rprime[0,:]) ynew = np.transpose(rprime[1,:]) #- fig4 = plt.figure( ax4 = fig4.add_subplot(1, 1, 1) plt.plot(xnew, ynew, 'x') plt.xlim([-6,6]) plt.ylim([-6,6]) ax4.set_title('Transformed Samples') ax4.set_aspect('equal') The transformed vectors will have a zero mean and zero correlation. Since the pdf is Gaussian, these variables will be independent. Pseudo code: # Stacking features to a matrix Data = np.matrix([x1.y1]) # 1. Compute the mean and covariance matrix # 2. Perform eigendecomposition of covariance matrix #3. Modify the code below to get uncorrelated and rotated features xnew # rprime = xnew = np.transpose(rprime[0.:]) ynew = np.transpose(rprime[1.:]) #- # Plotting fig4 = plt.figure() ax4 = fig4.add_subplot(1, 1, 1) plt.plot(xnew, ynew, 'x') plt.xlim([-6,6]) plt.ylim([-6,6]) Xnew = : UT (x − µ) ax4.set_title('Transformed Samples') ax4.set_aspect('equal') mu_rotated = np.array((np.matrix.mean(rprime,axis=0))) Sigma_rotated = np.cov(Data) 2. Feature Normalization/Whitening To do #2: Feature Normalization/Whitening Most machine learning algorithms work well when the input features are "normalized" (e.g independent and are zero mean). We will now look at a data whitening transformation, which will take the original features and spit out normalized feaures. Find the expression for the matrix A and vector b such that the transformed features Xnew = A(x-μ) are uncorrelated and indentically distributed with zero mean as in Figure 1. The A matrix can be obtained from the eigen decomposition of the covariance matrix Σ = UAUT as A = A-1/2 UT Pseudo Code: Data = np.matrix([x1.y1]) # Transformation # Modify the code below to get uncorrelated and uniformly distributed features -# rprime = xnew = np.transpose(rprime[0,:]) ynew = np.transpose(rprime[1,:]) #- fig4 = plt.figure( ax4 = fig4.add_subplot(1, 1, 1) plt.plot(xnew, ynew, 'x') plt.xlim([-6,6]) plt.ylim([-6,6]) ax4.set_title('Transformed Samples') ax4.set_aspect('equal')
Expert Answer:
Answer rating: 100% (QA)
To perform data whitening which is a common preprocessing step in machine learning to ensure that th... View the full answer
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these programming questions
-
For how long (in years) must you make $100 beginning of the month payments for before you have a future value of $1,000,000, if rates are 5% compounded semi-annually?
-
The City of Bainland has been undergoing financial difficulties because of a decrease in its tax base caused by corporations leaving the area. On January 1, 2010, the city has a fund balance of only...
-
A company is trying to decide whether to make a 400,000 investment in a new product area. The project will last 10 years and the 400,000 of machinery will have a zero scrap value. Other best estimate...
-
Happy Hands Company has net profit margin 5.51%, total assets turnover 0.63, and equity multiplier 2.77. What is its return on shareholder equity (ROE) using DuPont analysis method
-
For the ground-level harmonic oscillator wave function (x) given in Eq. (40.24), | |2 has a maximum at x = 0. (a) Compute the ratio of | |2 at = +A to | |2 at x = 0, where A is given by Eq. (40.27)...
-
Does providing additional information affect responses to a survey question? Two statistics students decided to investigate this issue by asking different versions of a question about texting and...
-
Rework Problem 10.14, part a, but exclude the region information. a. Comment on the difference in the models you have found. Is there indication that the region information substantially improves the...
-
Randy Owen invested $8,000 at 5% annual interest, and left the money invested without withdrawing any of the interest for 12 years. At the end of the 12 years, Randy withdrew the accumulated amount...
-
1. Why is steel a good material for cables? 2. What is wrong with a stone suspension bridge? 3. What is reinforced concrete?
-
On 1 January 20x1, Delphi Company issued 4% convertible bonds with a face value of $10,000,000 at par. The bond matured on 31 December 20x5. The bond was convertible into ordinary shares of Delphi...
-
Indiana University has just revealed an innovative college education-financing plan for new parents at the baby's birth (0 years old in this example). The plan allows parents to make a lump-sum...
-
2. When preparing different types of meet cuts how would you prepare a rack of lamb using Frenching technique
-
3 Jamie is a shareholder in Trolley Corporation. In the current year, Jamie receives 500 non-taxable shares of common stock from Trolley Corp. that are identical to the 270 shares of Trolley Corp....
-
In the Cuckoo's Egg, Cliff started his initial investigation by: In the Cuckoo's Egg, Cliff started his initial investigation by: auditing all root level accounts disabling Sventek account analyzing...
-
A factory is experiencing a reduction in sales that has lasted an extended period of time due to a recession. With inventory piling up in the warehouse, the factory should send everyone home until...
-
ABC Company is experiencing financial difficulties due to a down economy. As a result, XYZ Bank requested that ABC Company pledge additional collateral to secure a line of credit necessary to fund...
-
Why we do 2 types of earthing on transformer (i.e. :) body earthing & neutral earthing, what is function. i am going to install a 5oo kva transformer & 380 kva DG set what should the earthing value?
-
Find an equation of the given line. Slope is -2; x-intercept is -2
-
Batches of customer payments on account are processed manually in the cashiers office. Clerks open the payments, separate the checks and the remittance advices, and prepare a batch control total (two...
-
What are the functions of an audit committee?
-
ACE Company is a small start- up company that intends to publish electronic documents on the World Wide Web. It does not intend to engage in publishing any printed materials. Janet Thompson, the...
-
Can you name five types of channels of communication?
-
How would you define your own leadership style? Do you have examples you can share with others on how you lead when called on?
-
Revisit the definition of strategic communication and then review the vignette at the beginning of the chapter. Match the different terms in the definition to the different entities in the vignette.
Study smarter with the SolutionInn App