Hello,
I am working on creating a LightGBM model using a JMP Python script (JMP18).
My current setup is as follows:
- X variables: "train1.csv" file, columns D1 through D1776
- Y variable: "y1.csv" file, "Activity" column
- Prediction target "Activity": "test1.csv" file, columns D1 through D1776
- Note: Original file "train_original.csv" file, columns Activity through D1776. from Kaggle.com (Predicting a Biological Response)
I would appreciate it if somebody can provide the guidance for the following issues:
- Cannot perform LightGBM modeling in JMP18 python environment
I've included my JMP Python script below for your reference. See the followings for details.
Thank you for your time in advance! : )
import jmp
import jmputils
# update to latest version of pip (Package Installer of python) and setuptools then install numpy & pandas
jmputils.jpip('install --upgrade', 'pip setuptools')
jmputils.jpip('install', 'pandas numpy scikit-learn keras lightgbm')
# Import package
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Load data
train1 = pd.read_csv('D:/steve.kim/Kaggle/BI Biological Response/train1.csv')
y1 = pd.read_csv('D:/steve.kim/Kaggle/BI Biological Response/y1.csv')
test1 = pd.read_csv('D:/steve.kim/Kaggle/BI Biological Response/test1.csv')
train1.head() # No Result in JMP, but it's okay. It's fine to open the datatable using 'jmp.open'
y1.head() # No Result in JMP, but it's okay. It's fine to open the datatable using 'jmp.open'
# train1 = jmp.open('D:/steve.kim/Kaggle/BI Biological Response/train1.csv')
# y1 = jmp.open('D:/steve.kim/Kaggle/BI Biological Response/y1.csv')
# 01 Modeling training - Library import
from lightgbm import LGBMClassifier
# 02 Modeling training - LGBM Baseline model without hyperparameter tuning
lgb = LGBMClassifier()
# 03 Modeling training - define X (factors) and Y (responses) variables
lgb.fit(train1, y1) # lightgbm.basic.LightGBMError: Length of labels differs from the length of #data
# 04 Predict
predslgb = lgb.predict_proba(test1)