I am new to Ml_Modelling
I am working on a solution to create a model with three columns nature_of_business , industry, products.
| 业务性质|行业|产品|
| --|--|--|
| 制造商|资本货物|product1|
| 服务|采矿|product2|
| 其他|资本货物|产品展示|
| 制造商|商业服务|产品中心|Now, with the label encoder I'm encoding the entire Data Frame.
df = df.apply(LabelEncoder().fit_transform)
After this i have splitted the data into test and test and created the model
。Now, I'm trying to predict the Product using the model for a new Dataframe. I'm using the same Label encoder as used earlier.
df_Predict = pd.DataFrame({
'Industry_nature_of_business': ['Manufacturer'],
'Industry_Category': ['Capital Goods']})
df_encoded_Predict = df_Predict.apply(LabelEncoder().fit_transform)
predictions_train = knc.predict(df_encoded_Predict)
print(LabelEncoder().inverse_transform(predictions_train))
1条答案
按热度按时间ki0zmccv1#