In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to write the program of python machine learning". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to write the program of python machine learning".
Background introduction
With only six lines of Python, you can write the first machine learning program in your life! We will program using a supervised learning method, that is, a machine learning method that uses examples to create classifiers. Completed using python's machine learning library scikit-learn, it has a variety of classification, regression and clustering algorithms, including support vector machines, random forests, gradient enhancement, k-means and DBSCAN, designed to interoperate with Python numerical and science libraries NumPy and SciPy.
Getting started exampl
Code block:
# use only six lines of Python statement You can write the first machine learning program in your life from sklearn import tree# We write a machine learning program to identify apples and oranges # features for training data to represent Apple, Weight and surface characteristics of oranges # 1: surface smooth 0: surface bumpy # 140g surface smooth apple # 130g surface smooth apple # 150g surface bumpy orange # 170g surface bumpy orange features = [1401] # lables gives us the expected result tag # 0: Apple 1: tangerine labels = [0Power0Power1] # define the decision tree classification dtc = tree.DecisionTreeClassifier () # training data clf = dtc.fit (features,labels) # the predicted input data is 1 Orange print (clf.predict ([150Co0])). Thank you for your reading. The above is the content of "how to write the program of python machine learning". After the study of this article, I believe you have a deeper understanding of how to write the program of python machine learning, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.