<jupyter_start><jupyter_text>Task1. seperate 45 alag(for features) and 5 alag(labels)---using numpy<jupyter_code>label=iris.target<jupyter_output><empty_output><jupyter_text>How to Split data auto  using lib.     Sklearn use for this process<jupyter_code># now time for category of data -- --- -- dividing data

from sklearn.model_selection import train_test_split
data_split=train_test_split(features,label,test_size=0.2 ,random_state=30)   # here 20% is test data and 80% is train data

                                                            # bydefault 25% hota hai
                                                            # random state give same result for same input to same e
train_feat,test_feat,train_label,test_label=data_split     #train_feat-90% train data    train_label -- its ans
                                                            #test_feat-10% test data      test_label -- its ans
                                                            
from sklearn import tree
clf=tree.DecisionTreeClassifier()
trained=clf.fit(train_feat,train_label)
predicted=trained.predict(test_feat)
test_label
# now to check accuracy   sklearn has has lib

from sklearn.metrics import accuracy_score
accuracy_score(test_label,predicted)      ####  accuracy_score(actuall data, predicted data)
# iris data liya   sklearn   dataset  
# shape shape
# columns and rows'
# features and target
# fetch 20 percenta  or any pe    nikala
#fit kiya
# trained kiya
# predict kiya
# acuu nilai
# BEST WAY TO DETECT DATA IS TO MATCH FEATURE AND LABELS --ROWS
diabaties=[i for i in dir(datasets)   if 'dia' in i]
diabaties

datasets.load_diabetes<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06746268656716418, 'fraction_numerical': 0.011940298507462687, 'mean_word_length': 2.498956158663883, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '464719', 'license': 'Apache-2.0', 'n_tokens_mistral': 502, 'n_tokens_neox': 477, 'n_words': 148, 'path': 'iris_decision.ipynb', 'repo_name': 'Siddhant231096/ML', 'size': '1675'}