Skip to content

Commit

Permalink
segmentation fault fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ksiminski committed Nov 26, 2023
1 parent 274d3df commit 7725b2a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions source/neuro-fuzzy/three_way_decision_nfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void ksi::three_way_decision_nfs::createFuzzyRulebase(const ksi::dataset& train,

// zapisanie do zbioru_treningowego danych bliskich progowi
zbior_treningowy = extract_poor_results(zbior_treningowy, results_train, threshold_value, _noncommintment_value);
if (zbior_treningowy.size() < 1)
if (zbior_treningowy.size() < 1 or zbior_treningowy.size() < zbior_treningowy.getNumberOfAttributes())
{
// wszystkie nastepne systemy trzeba skasowac
remove_system = true;
Expand All @@ -200,7 +200,6 @@ double ksi::three_way_decision_nfs::answer(const ksi::datum& item) const
for (auto & pSystem : _cascade)
{
result = pSystem->answer(item);
debug(result);
auto threshold_value = pSystem->get_threshold_value();

if (std::fabs(result - threshold_value) > _noncommintment_value)
Expand Down

0 comments on commit 7725b2a

Please sign in to comment.