Hello everyone, I have been struggling at doing this by myself so I decided to finally ask for help. I am trying to train a model using images through a directory. I already got all the the images into a dataframe using cv2.imread but I cant figure out how to actually start training. I attempted to train with train_test_split with my first value being all of my normal columns in the dataframe and the second value being a specific one but it just gives me an error around model.fit(X_train, y_train). Any ideas where I should go next?
#๐ Model Training with images
5 messages ยท Page 1 of 1 (latest)
@earnest saddle
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
Heres the part in the code
feature_cols = ['ART', 'BLA', 'EBO','EOS', 'LYT', 'MMZ','MYB', 'NGB', 'NGS','PEB','PLM','PMO']
feature_cols2 = ['MON']
X = df[feature_cols]
y = df.MON
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2,random_state=1)
from sklearn.naive_bayes import GaussianNB
model = GaussianNB()
model.fit(X_train,y_train)
y_pred = model.predict(X_test)
@earnest saddle
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.