필터 지우기
필터 지우기

what is the option to save the weights from plotsomplanes?

조회 수: 1 (최근 30일)
shazia
shazia 2023년 6월 14일
댓글: shazia 2023년 6월 16일
i want to save the weights from plotsomPlanes so that i could use these waiegts as input for another network like ANFIS to improve the results is it possible? please guide
thank you

채택된 답변

Gourab
Gourab 2023년 6월 14일
Hi Shazia,
I understand that you want to save the weights from the plotsomPlanes function to use in some other network like ANFIS.
It's possible to use the weights obtained from the ‘plotsomPlanes’ function in the SOM network as inputs to other machine learning algorithms like ANFIS to improve their results.
We can extract the weights of the SOM neurons by accessing the children property of the plot object.
Please refer to the below code snippet
data = load('sample_data.mat');
net = selforgmap([10 10]);
net = train(net, data.inputs');
plotsomPlanes(net);
% Extract SOM weights
plot_obj = gcf; % Get handle of the SOM plots
weights = [];
for i = 1:length(plot_obj.Children)
if isa(plot_obj.Children(i), 'matlab.graphics.primitive.Image')
weights = [weights; plot_obj.Children(i).CData(:)'];
end
end
% Use SOM weights as input to ANFIS
anfis_in = [data.inputs', weights];
anfis_out = data.targets';
anfis_model = anfis(anfis_in, anfis_out);
I hope this helps you to resolve the query.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by