Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
RubyAM committed Jan 28, 2025
1 parent 09bfe61 commit 3d1ed9d
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 317 deletions.
134 changes: 0 additions & 134 deletions examples/breast_cancer/data/breast_cancer.py

This file was deleted.

85 changes: 0 additions & 85 deletions examples/breast_cancer/data/data_set.xml

This file was deleted.

79 changes: 0 additions & 79 deletions examples/breast_cancer/data/neural_network.xml

This file was deleted.

20 changes: 1 addition & 19 deletions examples/breast_cancer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ int main()

// Data set

DataSet data_set("../data/breast_cancer.csv", ";", true);

data_set.save("../data/data_set.xml");
data_set.load("../data/data_set.xml");
DataSet data_set("data/breast_cancer.csv", ";", true);

const Index input_variables_number = data_set.get_variables_number(DataSet::VariableUse::Input);
const Index target_variables_number = data_set.get_variables_number(DataSet::VariableUse::Target);
Expand All @@ -36,25 +33,15 @@ int main()
NeuralNetwork neural_network(NeuralNetwork::ModelType::Classification,
{ input_variables_number }, { neurons_number }, { target_variables_number });

neural_network.print();

// Training strategy

TrainingStrategy training_strategy(&neural_network, &data_set);

//training_strategy.set_loss_method(TrainingStrategy::LossMethod::MEAN_SQUARED_ERROR);
//training_strategy.set_optimization_method(TrainingStrategy::OptimizationMethod::STOCHASTIC_GRADIENT_DESCENT);


// OKR
training_strategy.set_loss_method(TrainingStrategy::LossMethod::MEAN_SQUARED_ERROR);
//training_strategy.set_loss_method(TrainingStrategy::LossMethod::MEAN_SQUARED_ERROR);
//training_strategy.set_loss_method(TrainingStrategy::LossMethod::MINKOWSKI_ERROR);
//training_strategy.set_loss_method(TrainingStrategy::LossMethod::WEIGHTED_SQUARED_ERROR);

// cross entropy

// OKR
//training_strategy.set_optimization_method(TrainingStrategy::OptimizationMethod::CONJUGATE_GRADIENT);
//training_strategy.set_optimization_method(TrainingStrategy::OptimizationMethod::LEVENBERG_MARQUARDT_ALGORITHM); //Fail
training_strategy.set_optimization_method(TrainingStrategy::OptimizationMethod::STOCHASTIC_GRADIENT_DESCENT);
Expand All @@ -68,11 +55,6 @@ int main()

testing_analysis.print_binary_classification_tests();

// Save results

neural_network.save("../data/neural_network.xml");
neural_network.save_expression(NeuralNetwork::ProgrammingLanguage::Python, "../data/breast_cancer.py");

cout << "Good bye!" << endl;

return 0;
Expand Down
Loading

0 comments on commit 3d1ed9d

Please sign in to comment.