Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to calculate the number of features in a training data using python?

$
0
0

@hinduja1234 wrote:

I am currently solving one classification problem using decision tree algorithm in python.
I have read that The more features the algorithm has available, the more chance for a complex fit.So I want to know the code by which I can calculate the number of features in training data.

My classifier code.
from sklearn import tree
clf = tree.DecisionTreeClassifier(min_samples_split=40)
clf= clf.fit(features_train,labels_train)
ypred= clf.predict(features_test)

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles