Downloads · 30 days
0
ianleelamb/battleship-mlp
battleship-mlp is a machine learning model from ianleelamb. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model predicts the probability that a given move in Battleship will result in a hit, based on a flattened feature vector representing the current board state, ship layout constraints, and spatial heuristics. It i…
Downloads · 30 days
0
Access
Public
Updated Nov 21, 2025
Repo size
160 KB
Likes
0
Public
Click a slice to open those files.
.h5159 KB · 97%
From the Hugging Face model README
This model predicts the probability that a given move in Battleship will result in a hit, based on a flattened feature vector representing the current board state, ship layout constraints, and spatial heuristics. It is designed for use in agentic game logic and can be integrated into automated Battleship agents for move selection, pruning, and top-k targeting.
The model expects a 1D vector of 16 features in the exact order listed in feature_list.txt. These features are extracted per candidate move using a flatten_record() function in your game logic. Example features include:
turn_numbercoverage_countnum_ships_that_can_fit_hereis_horizontal_hitis_vertical_hitcoverage_gradientis_adjacent_to_hitis_edge_cellis_diagonal_hitis_corner_cellis_center_cellis_legalis_impossiblecluster_sizeremaining_ship_countremaining_ship_max_lengthAll features must be normalized using the provided StandardScaler.
from tensorflow.keras.models import load_model
import joblib
import numpy as np
# Load model and scaler
model = load_model("battleship_mlp.h5")
scaler = joblib.load("battleship_scaler.pkl")
# Load feature order
with open("feature_list.txt") as f:
feature_order = f.read().splitlines()