<jupyter_start><jupyter_text>kaggle-房屋预测<jupyter_code>import torch
import torch.nn as nn
import numpy as np
import pandas as pd
import sys
sys.path.append('..')
import d2lzh_pytorch as d2l
print(torch.__version__)
train_data = pd.read_csv('./Datasets/house-prices/train.csv')
test_data = pd.read_csv('./Datasets/house-prices/test.csv')
train_data.shape
test_data.shape
train_data.iloc[0:4, [0,1,2,3,-3,-2,-1]]
all_features = pd.concat((train_data.iloc[:, 1:-1], test_data.iloc[:, 1:]))
numeric_features = all_features.dtypes[all_features.dtypes != 'object'].index
all_features[numeric_features] = all_features[numeric_features].apply(
    lambda x: (x - x.mean()) / (x.std())
)
all_features[numeric_features] = all_features[numeric_features].fillna(0)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1587708066581306, 'fraction_numerical': 0.019206145966709345, 'mean_word_length': 6.742574257425742, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '367703', 'license': 'MIT', 'n_tokens_mistral': 299, 'n_tokens_neox': 305, 'n_words': 47, 'path': 'Deep-Learning-Notes/3 Foundation/5-House-Predict-competition.ipynb', 'repo_name': 'zhiyu1998/JavaStudyXmind', 'size': '781'}