This repository contains my solutions to some of the exercises in the CS50 course. It also contains some additional projects around similar topics.
To run the files first create a virtual environment and install the requirements:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
From CS50, based on the given csv with shopping data train a KNeighboursClassifier to predict whether a customer will buy a product or not.
The functions to implement were load_data, train_model and evaluate.
A project to predict a given function using a genetic algorithm.
A project to solve the knapsack problem using a genetic algorithm.
From CS50, run runner.py to play. The functions add_knowledge, make_safe_move and make_random_move were left to implement.
A project to predict numbers from the mnist dataset using a tensorflow. Experiment notes are in the notebook.
From CS50, project to predict categories of traffic signs from the GTSRB dataset. More notes in the README in the folder.
From CS50, project to generate a crossword puzzle with backtracking. The functions to implement were enforce_node_consistency, revise, ac3, assignment_complete, consistent, order_domain_values, select_unassigned_variable and backtrack.
A project to solve Sudoku with backtracking, implementation under search/sudoku.
From CS50, project to play Nim against an AI. The functions to implement were get_q_value, update_q_value, best_future_reward and choose_action.
A project to implement different search algorithms from scratch. There are different frontier classes that can be exchanged to use them.
An attempt to use search algorithms to solve Sudoku. The backtracking implementation is also here.
A project to play tic tac toe with minimax players. There is one implementation with and without alpha beta pruning.