danupurnomo/dummy-titanic
Titanic (Survived/Not Survived) – Binary Classification
How to use
from huggingface_hub import hf_hub_url, cached_download
import joblib
import pandas as pd
import numpy as np
from tensorflow.keras.models import load_model
REPO_ID = 'danupurnomo/dummy-titanic'
PIPELINE_FILENAME = 'final_pipeline.pkl'
TF_FILENAME = 'titanic_model.h5'
model_pipeline = joblib.load(cached_download(
hf_hub_url(REPO_ID, PIPELINE_FILENAME)
))
model_seq = load_model(cached_download(
hf_hub_url(REPO_ID, TF_FILENAME)
))
Example A New Data
new_data = {
'PassengerId': 1191,
'Pclass': 1,
'Name': 'Sherlock Holmes',
'Sex': 'male',
'Age': 30,
'SibSp': 0,
'Parch': 0,
'Ticket': 'C.A.29395',
'Fare': 12,
'Cabin': 'F44',
'Embarked': 'S'
}
new_data = pd.DataFrame([new_data])
Transform Inference-Set
new_data_transform = model_pipeline.transform(new_data)
Predict using Neural Networks
y_pred_inf_single = model_seq.predict(new_data_transform)
y_pred_inf_single = np.where(y_pred_inf_single >= 0.5, 1, 0)
print('Result : ', y_pred_inf_single)
# [[0]]
收录说明:
1、本网页并非 danupurnomo/dummy-titanic 官网网址页面,此页面内容编录于互联网,只作展示之用;
2、如果有与 danupurnomo/dummy-titanic 相关业务事宜,请访问其网站并获取联系方式;
3、本站与 danupurnomo/dummy-titanic 无任何关系,对于 danupurnomo/dummy-titanic 网站中的信息,请用户谨慎辨识其真伪。
4、本站收录 danupurnomo/dummy-titanic 时,此站内容访问正常,如遇跳转非法网站,有可能此网站被非法入侵或者已更换新网址,导致旧网址被非法使用,
5、如果你是网站站长或者负责人,不想被收录请邮件删除:i-hu#Foxmail.com (#换@)
前往AI网址导航