フィルターのクリア

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 Center および File ExchangePattern Recognition and Classification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by