<jupyter_start><jupyter_text>Using scikit learn for Machine learning  * Simple and efficient tools for data mining and data analysis* Accessible to everybody, and reusable in various contexts* Built on NumPy, SciPy, and matplotlib* Open source, commercially usable - BSD license  Data Representation in Scikit-Learn<jupyter_code>import seaborn as sns
iris = sns.load_dataset('iris')
iris.head()<jupyter_output><empty_output><jupyter_text>Feature Matrix X[]Two dimentional with shape [n_samples, n_features], and is often contained in a NumPy array or a Pandas DataFrame.  Target array yUsually one dimentional with shape [n_samples], and is generally contained in a NumPy array or Pandas Series  Creating Training data<jupyter_code>X_iris = iris.drop('species', axis=1)
X_iris.shape
y_iris = iris['species']
y_iris.shape<jupyter_output><empty_output><jupyter_text>![image.png](attachment:image.png)  Scikit-Learn's Estimator API Provides a consistent interface for a wide range of machine learning applications  Steps in using the Scikit-Learn estimator API * Choose a class of model * Choose model hyperparameters* Arrange data into a features matrix and target vector* Fit the model to your data by calling the fit() method* Apply the Model to new data<jupyter_code>from sklearn.naive_bayes import GaussianNB # 1. choose model class
model = GaussianNB()                       # 2. instantiate model
model.fit(X_iris, y_iris)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06868131868131869, 'fraction_numerical': 0.0020604395604395605, 'mean_word_length': 5.714285714285714, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '262745', 'license': 'MIT', 'n_tokens_mistral': 451, 'n_tokens_neox': 422, 'n_words': 163, 'path': 'Section 1/Using scikit learn for Machine learning.ipynb', 'repo_name': 'TinasheS/python1', 'size': '1456'}