I need help about the imbalanced data
显示 更早的评论
i have a data set , but i couldn't manage to get a good solution . I will be apprecite if you help me to handle imbalanced data. Thanks a lot
采纳的回答
Read about readtable.
After reading you can access the rspective columns using T.T1, T.T2 etc... or T.(1), T.(2) etc.
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/744984/data.xlsx')
T = 500×9 table
T1 T2 T3 T4 T5 T6 T7 T8 RESULT
____ ____ ____ ____ ____ ____ ____ ____ ______
12.5 6.25 1.05 11 3 1.3 1.75 1.6 3
2.7 2.7 2.2 3.35 1.75 2.8 1.55 1.8 2
2.5 2.9 2.2 3.2 1.75 3 1.65 1.7 3
2.5 2.9 2.2 3.05 1.85 2.8 1.45 1.95 3
2.7 3 2 3.5 1.8 2.8 1.65 1.7 2
2.5 3.1 2.1 3.05 2 2.8 1.3 2.3 2
9 4 1.2 7.5 2.35 1.6 1.85 1.5 1
3.4 3.3 1.65 3.75 2.2 2.15 1.5 1.85 2
3.2 3 1.8 3.75 1.8 2.55 1.7 1.65 3
8 4.3 1.2 7 2.5 1.5 1.6 1.75 3
5.5 3.6 1.35 5.25 2.3 1.75 1.7 1.65 3
2.5 3.1 2.1 3.2 1.95 2.7 1.55 1.8 3
2.5 2.7 2.3 3.2 1.7 3.05 1.65 1.7 3
5.5 4.6 1.25 5 2.6 1.6 1.55 1.8 3
6.25 3.75 1.3 5.25 2.4 1.65 1.55 1.8 3
4 3.6 1.5 4.25 2.4 1.9 1.35 2.15 3
5 个评论
it doesn't help me. I have already done this, i have tried neural network but regregerssion is very bad.. Thanks
What exactly you are trying?
I am trying to get a good workign neural network.. But i couldn't
Neural network for what?
clear all;
close all;
clc
data=xlsread('data.xlsx');
input=data(:,1:8);
output=data(:,end);
x=input';
t=output';
trainFcn='trainlm';
hiddenLayerSize=[10 8 3];
net=feedforwardnet(hiddenLayerSize, trainFcn);
net.layers(1).transferFcn='tansig';
net.layers(2).transferFcn='tansig';
net.layers(3).transferFcn='tansig';
net.input.processFcns={'removeconstantrows', 'mapminmax'};
net.output.processFcns={'removeconstantrows', 'mapminmax'};
net.divideFcn='dividerand';
net.divideMode='sample';
net.divideParam.trainRatio=70/100;
net.divideParam.valRatio=20/100;
net.divideParam.testRatio=10/100;
net.trainParam.show=25;
net.trainParam.lr=0.001;
net.trainParam.epochs=100;
net.trainParam.goal=0;
net.trainParam.max_fail=50;
net.trainParam.mc=0.9;
net.trainParam.min_grad=0;
net.performFcn='mse';
net.plotFcns={'plotform', 'plottrainstate','ploterrhist','plotregression', 'plotfit'};
[net,tr]=train(net,x,t);
y=net(x);
e=gsubtract(t,y);
performance=perform(net,t,y);
trainTargets=t.*tr.trainMask(1);
valTargets=t.*tr.valnMask(1);
testTargets=t.*tr.testMask(1);
trainPerformance=perform(net,trainTargets,y);
valPerformance=perform(net,valTargets,y);
testPerformance=perform(net,testTargets,y);
a=trainFcn;
b=hiddenLayerSize;
f1=net.layers(1).transferFcn;
f2=net.layers(2).transferFcn;
f3=net.layers(3).transferFcn;
f=trainPerformance;
g=valPerformance;
k=testPerformance;
result=[a,',',num2str(b),',',f1,',',f2,',',f3,',', num2str(f),',',num2str(g),',',num2str(k)];
disp(result)
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Vehicle Dynamics Blockset 的更多信息
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
