<jupyter_start><jupyter_text>10 Feature perceptron<jupyter_code>regr = LinearRegression()
selector = RFE(regr, 10, step=1, verbose=0)
selector.fit(X, y)
usecols = feats.columns[selector.support_]
X = X[:, selector.support_]

num_inputs = X.shape[1]
# model = Sequential()
# model.add(Dense(batch_size, input_dim=num_inputs, kernel_initializer='normal', activation='relu'))
# model.add(Dense(num_outputs, kernel_initializer='normal'))
# # Compile model
# model.compile(optimizer='rmsprop', loss='mse')

# print(f"Starting training process with epochs:{epochs} & batch size:{batch_size}")
# model.fit(X, y, epochs=epochs, batch_size=batch_size)

model = LinearRegression()
model.fit(X, y)<jupyter_output><empty_output><jupyter_text>Validation<jupyter_code>val_feats = pd.read_csv("../data/processed/validation_features.csv", usecols=usecols)
val_target = pd.read_csv("../data/processed/validation_target.csv")

X_val = val_feats.values
y_val = val_target.target.values

y_pred = model.predict(X_val)
print("MAE: %f" % mean_absolute_error(y_val, y_pred))
print("MSE: %f" % mean_squared_error(y_val, y_pred))
f, ax = plt.subplots(figsize=(6.5, 6.5))
sns.scatterplot(x=y_pred.reshape(-1), y=y_val)
y_pred.shape<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15870445344129555, 'fraction_numerical': 0.009716599190283401, 'mean_word_length': 8.223880597014926, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '589800', 'license': 'FTL', 'n_tokens_mistral': 492, 'n_tokens_neox': 482, 'n_words': 70, 'path': 'notebooks/feature-selection.ipynb', 'repo_name': 'KennedyMurphy/elomerchant', 'size': '1235'}