필터 지우기
필터 지우기

Building machine learning model

조회 수: 1 (최근 30일)
An Van
An Van 2020년 8월 8일
댓글: keerthana pothula 2021년 6월 2일
Hello,
I am having problem in creating machine learning model.
I try to use
fitcknn (), fitctree ()
to build a model.
However the fitcknn gives me some errors that I dont know how to fix.
Here is my code
load timefeat;
train = (time);
a = length(train);
timefeat_t=[];
for sg=1:a
timefeat_t=[timefeat_t, train{1,sg}];
Lengths_T(sg)=length(train{1,sg});
end
X=timefeat_t';
n_obs=size(timefeat_t,2);
y=cell(n_obs,1);
group1=sum(Lengths_T(1:1));
group2=group1+sum(Lengths_T(2:end));
y(1:group1)={'low speed'}; % Class 1 definition - Train
y(group1+1:group2)={'high speed'}; % Class 2 definition - Train
X_Train=X;
Y_Train=y;
T_Train=table(X,y);
Model2_1=fitcknn(T_Train.X,T_Train.y,...
'NumNeighbors',10,'Distance','cityblock');
Model2_2=fitctree(T_Train.X,T_Train.y);
I have included the data file "timefeat.mat"
Could anyone please check my code and help me understand what error did I make and how should i fix it?
Thank you
  댓글 수: 1
keerthana pothula
keerthana pothula 2021년 6월 2일
Machine Learning is a core component of Artificial Intelligence that includes how machines can analyze data, identify patterns and make decisions with low to no human intervention. With the ever-increasing demand for machine automated solutions ML has become one of the rapidly evolving technology along with AI & Data Science.
Find the Latest Machine Learning projects based on ML algorithms for open source machine learning.
Facial Emotion Detection using Neural Networks
Cancer Prediction using Naive Bayes
Tour Recommender App Using Collaborative Filtering
Driver Drowsiness Detection System for Accident Prevention
Automatic Salt Segmentation with UNET in Python using
Deep Learning Transformer Conversational Chatbot in Python using TensorFlow
2.0 Lane-Line Detection System in Python using OpenCV
Facial Emotion Recognition and Detection in Python using Deep Learning
Diabetes Prediction Using Data Mining
Data Mining for Sales Prediction in Tourism Industry
Higher Education Access Prediction
Software Hotel Recommendation System Based on Hybrid Recommendation Model

댓글을 달려면 로그인하십시오.

채택된 답변

Nipun Katyal
Nipun Katyal 2020년 8월 12일
Hi, as you have only two labels such a large number of neighbours are not required, Instead you can change the distance to 'cosine' and try shuffling the rows. You can find improved result using the configurations below,
Model2_1=fitcknn(T_Train.X,T_Train.y,...
'NumNeighbors',5,'Distance','cosine');
  댓글 수: 1
An Van
An Van 2020년 8월 16일
Thank you, after changing the define, it works

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by