error with reshape of number of elements 
hello, 
i'm working with multi-class classification by using function fitcecoc. 
featureste is a 1063x22 matrix while wte is a 1063x1 vector. 
running the code shown below, a message error is given, saying: 'to reshape the number of elements must not change'
error is given at the following line:
reshape(max(posteriorregion,[ ],2),size(x1grid,1),size(x1grid,2)))
how can i fix it? thank you in advance


mdl = fitcecoc(featureste,wte,'learners',t,'fitposterior',1,...
 'classnames',{'1','2','3'},...
 'verbose',2)

%cross-validate mdl using 10-fold cross-validation.
cvmdl = crossval(mdl);

%cvmdl is a classificationpartitionedecoc cross-validated ecoc classifier.
%estimate the classification error.
loss = kfoldloss(cvmdl); 

%define a grid of values in the observed predictor space. 
%predict the posterior probabilities for each instance in the grid.
xmax = max(featureste);
xmin = min(featureste);

x1pts = linspace(xmin(1),xmax(1));
x2pts = linspace(xmin(2),xmax(2));
[x1grid,x2grid] = meshgrid(x1pts,x2pts);

[~,~,~,posteriorregion] = predict(mdl,[x1grid(:),x2grid(:)]);

%for each coordinate on the grid
%plot the maximum class posterior probability among all classes.
figure
contourf(x1grid,x2grid,...
 reshape(max(posteriorregion,[],2),size(x1grid,1),size(x1grid,2)))

hold on
gh = gscatter(featureste(:,1),featureste(:,2),wte,'krk','*xd',8)
gh(2).linewidth = 2;
gh(3).linewidth = 2;
hold off
here's my guess. you create x1pts and x2pts without specifying the number of elements you want. when you do that, you get a vector with length 100. see this comment from the documentation page:
y = linspace(x1,x2) returns a row vector of 100 evenly spaced points between x1 and x2.
therefore, x1grid and x2grid and 100x100.
i have no idea what the size of posteriorrange is, but max(posteriorregion,[],2) must not be a 10000 x 1 (size(x1grid,1) = size(x1grid,2) = 100).
this error is caused by some bugs with tensorflow’s freeze graph tool. it can happen when you try to convert a model that was created with a different version of tensorflow, but it also seems to happen randomly.

you can fix it by manually adjusting the bugged nodes:

# load saved model and freeze g… What problem are you facing? Post the error that you get.  

Also please edit your first post by aligning the code properly and wrap [code] tag so that it is easily understandable for us to analyze. Since this is an older post, I'm assuming you've solved this issue. Incase others find this post, I'll post the link to the documentation below


 


[https://experienceleague.adobe.com/docs/analytics/components/classifications/c-sub-classifications.h...](https://experienceleague.adobe.com/docs/analytics/components/classifications/c-sub-classifications.html?lang=en#classifications)




[View solution in original post](/t5/adobe-analytics-questions/how-can-i-get-classifications-to-output-correctly-to-the-new/m-p/397907#M27359) direction: a word and number arrangement machine when given an input line of word and numbers rearranges them following a particular rule in each step. the following is an illustration of input and rearrangement. input: politics 61 policy 116 partner 93 role 45 clear 27 38 point step i: role politics policy 116 partner 93 45 clear 27 38 point 61 step ii: role clear politics policy partner 93 45 27 38 point 116 61 step iii: role clear partner politics policy 93 45 38 point 27 116 61 step iv: role clear partner politics policy 93 38 point 45 27 116 61 step v: role clear partner politics point policy 93 38 45 27 116 61 step v, is the last step of the above arrangement as the intended arrangement is obtained. as per the rule followed in the given steps find out the appropriate steps for the given input. input: energy 54 78 place 23 issue 211 145 flat rent taxi 17in step iii, what is the difference between fifth element from left and second element from right? finding the correct answer here is important, but perhaps equally important is finding it using the method of matrix reduction, since those are the instructions.the augmented matrix is4 -2 -5 -514 -1 -2 -364 -2 4 -24you'll have to forgive the poor formatting. this answer box doesn't have a proper math symbol editor.using elementary row operations, the reduced row echelon form of the augmented matrix is1 0 0 -60 1 0 60 0 1 3from which we conclude that the system has a unique solution (-6,6,3). ok so, you're simply making a wrong aggregation in your y-axis. what you want to do is make 3 aggregations of type sum, each one for a specific category (men-women-children), like the following:

[[image]](https://aws1.discourse-cdn.com/elastic/original/3x/4/4/441907755076ca3a9417b959036a79f906d45448.png "image")

though, if you want to make something more professional and good-looking, since you're interes… After 5 hours of learning I have compiled these:


Mindset



1. **Make sure the placed image ratio is good** to make it more realistic. This can be attained by checking with the other object in the output picture, like trees, or other peoples' height. You are not going to place human with the size much smaller than the other human at the same picture. Similarly, you also must not place a person with the height higher than a tree.
2. **Get the right perspective**. Sometimes, when an object is placed in an odd perspective, image is going to look very bold that it has been photoshopped or copy pasted.
3. **Lighting**. It is important to pay attention to light source, like the sun, and make sure our object is appropriate with output background light source. This can be done by adjusting the lighting of object and adding shadow with referencing other shadow in output image.


Tools (to make edges more realistic)



1. **Layer masking.** If moving people, hair can look awful if just plainly moved. Masking allows us to further tweak our selection.
2. **Refine edge.** *This tool allows you to control many aspect of the edge of your selection* (desired object to move), like Edge Detection (brushing the edges of object and let photoshop do its job, usually around dog fur), Feather (Soften the area of selection), Smooth (reduce pointiness of your selection), Contrast (somewhat opposite of smooth), and Shift Edge (moving feather far or nearer the selection, usually to remove excess background color near the edges). *REFERENCE: <https://www.youtube.com/watch?v=5lDr2Nd8Yl4>*
3. **Layer Matting**. Inside we have many sub-tools to work on, like Color Decontamination (spread out soft mask around the edge, usually for hair to catch other hair that accidentally masked or can be used similarly to Shift Edge), Remove Matte (soften edge of sharp graphic or pixalated, raster look). *REFERENCE: <https://www.youtube.com/watch?v=N6K_htNQPPA>*
4. **Image Calculation**. By playing with the blending, we can make the background darker; thus, helping us making mask. *REFERENCE: <https://www.youtube.com/watch?v=0zf-H9RoCNk>* i suspect that the resource\_exhausted message may have originated from a back-pressuring committer node ([code](https://github.com/digital-asset/daml/blob/926fb5997a795e7f80443a9a3ba7898b1568d158/ledger/participant-integration-api/src/main/scala/platform/apiserver/services/apisubmissionservice.scala#l155-l157)). if that’s the case, i believe the approach should be the same: change the configuration if you need and make sure to handle those errors with the appropriate retry strategy. the order of these attributes in your file is wrong. 
change it to this: 
/*first floor*/
switch bedroomlights "bedroom lights" <light> (ff\_bedroom) [ "switchable" ] { channel="wemo:socket:bedroomlights:state" }
switch testone "test one" <light> (ff\_bedroom) [ "swi… A segmentation fault in this case probably means you accessed one of the arrays out of bounds. Start up a debugger and keep a watch on your indices.