Created
October 16, 2014 02:55
-
-
Save dgonzo/85fdf588e2b7ce8cf3b7 to your computer and use it in GitHub Desktop.
15minHeadphones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| context_map=csvread('train_X_final.csv'); % Load train input (context matrix) | |
| sim_yield_die_loss=csvread('train_Y_final.csv'); % Load train output | |
| wafer_count=size(context_map,1); % Get number of wafers | |
| %Build regular WLSR model +++++++++++++++++++++++++++++++++++++++++++++++++ | |
| lambda=0.4; %Decay rate on learning | |
| w_diag=fliplr(lambda.^(1:wafer_count)); | |
| W=zeros(wafer_count); | |
| for g=1:wafer_count | |
| W(g,g)=w_diag(g); | |
| end | |
| beta_WLSR=pinv(context_map'*W*context_map)*context_map'*W*sim_yield_die_loss'; | |
| context_map_val=csvread('val_X_final.csv'); %Load train input (context matrix) | |
| %Evaluate models | |
| yp_WLSR=context_map_val*beta_WLSR; | |
| %Make sure to cap crazy results outside possible die >600 <0 | |
| yp_WLSR(yp_WLSR<0)=0; | |
| yp_WLSR(yp_WLSR>600)=600; | |
| %Now write out prediction | |
| csvwrite('WLSR_prediction_04.csv',yp_WLSR) | |
| %Now calc and write out cost | |
| Y_val=csvread('testing/val_Y.csv'); | |
| Y_pred=csvread('WLSR_prediction_04.csv'); | |
| err=Y_pred-Y_val; | |
| err_over=sum(abs(err(err>=0))); | |
| err_under=sum(abs(err(err<0)))*10; | |
| overall_score_LSR=(err_under+err_over)/wafer_count; | |
| overall_score_LSR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment