What Will This Yacht's Resistance Be?
Given a hull's shape and speed, how much will the water push back? Testing every design in a tank is slow and expensive, so engineers want a number they can trust before the test. The same pattern fits any measurement you'd like to predict from a few hundred rows: a yield, a delivery time, a price.
The table
Yacht Hydrodynamics has 308 tank tests. Six columns describe the hull and its speed, and the seventh, Residuary.resistance, is the number to predict. It's in Welt's research catalogue, so you can load it in one line.
Walkthrough
Load the table
Search the research catalogue and load the table into a DataFrame.
from welt import Client with Client() as client: page = client.research_datasets(q="yacht", availability="available", limit=5) yachts = client.load_research_dataset(page["items"][0]["id"])Hold some rows back
Keep 30% of the tests aside, so you can check the predictions against real measurements.
from sklearn.model_selection import train_test_split target = "Residuary.resistance" train, test = train_test_split(yachts, test_size=0.3, random_state=9)Predict and check
Fit on the training rows and predict the held-back ones. There's nothing to tune.
from welt import Regressor from sklearn.metrics import mean_absolute_error model = Regressor(model="tabicl-v2", random_state=9) model.fit(train, target=target) predictions = model.predict(test.drop(columns=target)) print("Average error:", mean_absolute_error(test[target], predictions))
What you get
Try it
Use Open with to run the regression notebook in Colab, Kaggle or Jupyter, or run the code above after pip install "welt-client[parquet]" scikit-learn.
Open with
- Type
- Use case
- Area
- Engineering
- Question
- What Will This Yacht's Resistance Be?
- Model
- TabICLv2
- Data
- Yacht Hydrodynamics, 308 hull tests, from Welt's research catalogue
- For
- Engineers and analysts predicting a measurement