This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
titanic.drop(columns=['sex']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
titanic.drop(['pclass'], axis=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isHuman = 0 | |
for images in human_files_short: | |
if face_detector(images) == True: | |
isHuman +=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''MINIMAX GET MOVES:''' | |
self.time_left = time_left | |
# Initialize the best move so that this function returns something | |
# in case the search fails due to timeout | |
'''best_move = (1, 1)''' | |
legal_moves = game.get_legal_moves() | |
if legal_moves == []: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
This script evaluates the performance of the custom_score evaluation | |
File "/Users/charliecraine/Documents/GitHub/AIND-Isolation-master/tournament.py", line 157, in <module> | |
function against a baseline agent using alpha-beta search and iterative | |
main() | |
deepening (ID) called `AB_Improved`. The three `AB_Custom` agents use | |
ID and alpha-beta search with the custom_score functions defined in | |
File "/Users/charliecraine/Documents/GitHub/AIND-Isolation-master/tournament.py", line 153, in main | |
game_agent.py. | |
play_matches(cpu_agents, test_agents, NUM_MATCHES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AlphaBetaPlayer(IsolationPlayer): | |
"""Game-playing agent that chooses a move using iterative deepening minimax | |
search with alpha-beta pruning. You must finish and test this player to | |
make sure it returns a good move before the search time limit expires. | |
""" | |
def get_move(self, game, time_left): | |
"""Search for the best move from the available legal moves and return a | |
result before the time limit expires. | |
Modify the get_move() method from the MinimaxPlayer class to implement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AlphaBetaPlayer(IsolationPlayer): | |
"""Game-playing agent that chooses a move using iterative deepening minimax | |
search with alpha-beta pruning. You must finish and test this player to | |
make sure it returns a good move before the search time limit expires. | |
""" | |
def get_move(self, game, time_left): | |
"""Search for the best move from the available legal moves and return a | |
result before the time limit expires. | |
Modify the get_move() method from the MinimaxPlayer class to implement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AlphaBetaPlayer(IsolationPlayer): | |
"""Game-playing agent that chooses a move using iterative deepening minimax | |
search with alpha-beta pruning. You must finish and test this player to | |
make sure it returns a good move before the search time limit expires. | |
""" | |
def get_move(self, game, time_left): | |
"""Search for the best move from the available legal moves and return a | |
result before the time limit expires. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failed Test: 7. Test functionality of AlphaBetaPlayer.alphabeta() | |
---------------------------------------------------------------------- | |
AssertionError: False is not true : Your AlphaBetaAgent.alphabeta function returned a move that was not the optimal move for the given heurisitc. Make sure that you choose the first branch with the max score at the top level; branches searched later that return the same max score may only be returning an upper bound. | |
Expected Best Move: | |
(5, 5) | |
Your Selection: (7, 5) | |
Test Case Details: | |
------------------ | |
Heuristic: open_move_score |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AlphaBetaPlayer(IsolationPlayer): | |
self.time_left = time_left | |
def terminal_test(self, game): | |
if self.time_left() < self.TIMER_THRESHOLD: | |
raise SearchTimeout() | |
return not bool(game.get_legal_moves()) |
NewerOlder