<jupyter_start><jupyter_text><jupyter_code>encoded_data = enc.fit_transform(collection_data_df_cat)
encoded_data
categorical_variables = ['Background Color','Collection Name']
encoded_df = pd.DataFrame(encoded_data, columns = enc.get_feature_names(categorical_variables))
# YOUR CODE HERE

# Review the DataFrame
# YOUR CODE HERE
encoded_df

X_train_five, X_test_five, y_train_five, y_test_five = train_test_split(encoded_df, lsp, random_state = 1)




collection_data_df.corr()
collection_data_df.dtypes
collection_data_df["Background Color"].value_counts()
collection_data_df["Collection Name"].value_counts()
ml_data_df = df[['id', 'num_sales']].copy()
ml_data_df = pd.concat([ml_data_df, total_price, total_traits], axis = 1)
ml_data_df.columns = ['Asset ID', 'Number of Sales','Last Sale Price (ETH)', 'Trait Count']
ml_data_df
ml_data_df.corr()
ml_data_df.dtypes
ml_data_df.describe()
import seaborn as sns

import pandas as pd

import numpy as np

import matplotlib.pyplot as plt

%matplotlib inline

import seaborn as sns

from sklearn import linear_model
ml_data_df.shape
ml_data_df = ml_data_df[~ml_data_df.index.duplicated()]
ml_data_df.columns
x = ml_data_df[['Number of Sales', 'Trait Count']]
x_two = ml_data_df[['Trait Count']]
y = ml_data_df['Last Sale Price (ETH)']
from sklearn.model_selection import train_test_split
z = ml_data_df['Number of Sales']
x_train, x_test, y_train, y_test = train_test_split(x, z, test_size = 0.3)
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size = 0.3)

from sklearn.linear_model import LinearRegression, LogisticRegression
x_train_two, x_test_two, y_train_two, y_test_two = train_test_split(x_two, z, test_size = 0.3)
model_two = LinearRegression()
model_two.fit(x_train_two, y_train_two)
print(model_two.coef_)
print(model_two.intercept_)
model = LinearRegression()
model.fit(x_train, y_train)
print(model.coef_)<jupyter_output>[0.04630943 0.        ]<jupyter_text><jupyter_code>print(model.intercept_)<jupyter_output>2.2595467065868267<jupyter_text><jupyter_code>pd.DataFrame(model.coef_, x.columns, columns = ['Coeff'])
model_log_one = LogisticRegression()
model_log_one.fit(x_train, y_train)



predictions = model.predict(x_test)
plt.scatter(y_test, predictions)
plt.hist(y_test - predictions)
from sklearn import metrics
metrics.mean_absolute_error(y_test, predictions)

metrics.mean_squared_error(y_test, predictions)
np.sqrt(metrics.mean_squared_error(y_test, predictions))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10931827349737798, 'fraction_numerical': 0.014118596208148447, 'mean_word_length': 8.05109489051095, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '438644', 'license': 'MIT', 'n_tokens_mistral': 971, 'n_tokens_neox': 926, 'n_words': 176, 'path': 'collection_data10_15.ipynb', 'repo_name': 'RJGiannini/nft-project-group8', 'size': '2479'}