<jupyter_start><jupyter_text>VI. Running a prediction (inference)Now we are sure that our model uses the best algorithm. That the algorithm has been improved and the model generalizes well.Therefore, we can proceed to use our prediction model to predict unkown labels.<jupyter_code># import libraries
import pandas as pd
from sklearn import preprocessing
import sklearn.model_selection as ms
from sklearn import linear_model
import sklearn.metrics as sklm
import numpy as np
import numpy.random as nr
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats as ss
import math
from sklearn.model_selection import train_test_split 
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_log_error
from sklearn import metrics

%matplotlib inline
%matplotlib inline
from sklearn.externals import joblib
from joblib import dump, load
test = pd.read_csv('testprepared.csv')<jupyter_output><empty_output><jupyter_text>After reducing the feature space, I now need to select only the columns I used on the X_train.The columns are: Index(['price', 'capacity', 'failure_rate', 'margin', 'Quality:_Basic',       'Warranty_years:_2', 'Quality:_Medium', 'Perc_Margin:_Low'],      dtype='object')<jupyter_code>test.columns
test_final=test[['price', 'capacity', 'failure_rate', 'margin', 
                 'Quality:_Basic', 'Warranty_years:_2', 'Quality:_Medium', 'Perc_Margin:_Low']]
test_final.head()
clf = load('Forestimproved.joblib')
predictionfinal = clf.predict(test_final)
import numpy as np
import pandas as pd
predictionfinal = pd.DataFrame(predictionfinal).to_csv('predictionfinal.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0835838845460012, 'fraction_numerical': 0.0012026458208057728, 'mean_word_length': 6.495495495495495, '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': '78205', 'license': 'MIT', 'n_tokens_mistral': 506, 'n_tokens_neox': 488, 'n_words': 164, 'path': '7. Runnig a prediction( inference).ipynb', 'repo_name': 'titoniubo/x_biamow', 'size': '1663'}