This tutorial demonstrates using Visual Studio Code and the Microsoft Python extension with common data science libraries to explore a basic data science scenario. Specifically, using passenger data from the Titanic, you will learn how to set up a data science environment, import and clean data, create a machine learning model for predicting survival on the Titanic, and evaluate the accuracy of the generated model. Show PrerequisitesThe following installations are required for the completion of this tutorial. Make sure to install them if you haven't already.
Set up a data science environmentVisual Studio Code and the Python extension provide a great editor for data science scenarios. With native support for Jupyter notebooks combined with Anaconda, it's easy to get started. In this section, you will create a workspace for the tutorial, create an Anaconda environment with the data science modules needed for the tutorial, and create a Jupyter notebook that you'll use for creating a machine learning model.
Prepare the dataThis tutorial uses the Titanic dataset available on OpenML.org, which is obtained from Vanderbilt University's Department of Biostatistics at https://hbiostat.org/data. The Titanic data provides information about the survival of passengers on the Titanic and characteristics about the passengers such as age and ticket class. Using this data, the tutorial will establish a model for predicting whether a given passenger would have survived the sinking of the Titanic. This section shows how to load and manipulate data in your Jupyter notebook.
Train and evaluate a modelWith the dataset ready, you can now begin creating a model. For this section, you'll use the scikit-learn library (as it offers some useful helper functions) to do pre-processing of the dataset, train a classification model to determine survivability on the Titanic, and then use that model with test data to determine its accuracy.
(Optional) Use a neural networkA neural network is a model that uses weights and activation functions, modeling aspects of human neurons, to determine an outcome based on provided inputs. Unlike the machine learning algorithm you looked at previously, neural networks are a form of deep learning wherein you don't need to know an ideal algorithm for your problem set ahead of time. It can be used for many different scenarios and classification is one of them. For this section, you'll use the Keras library with TensorFlow to construct the neural network, and explore how it handles the Titanic dataset.
Next stepsNow that you're familiar with the basics of performing machine learning within Visual Studio Code, here are some other Microsoft resources and tutorials to check out. Append di python untuk apa?Append. Salah satu fitur dalam array python yang cukup sering digunakan adalah fungsi append. Fungsi append ini berguna untuk menambahkan nilai array pada urutan terakhir. Fungsi ini sedikit berbeda dengan fungsi insert, dimana fungsi insert bisa menambahkan nilai array pada posisi tertentu.
Bagaimana cara mengakses Tuple?Untuk mengakses nilai dalam Tuple, maka kamu bisa menggunakan tanda kurung siku untuk mengiris beserta indeks agar mendapatkan nilai yang tersedia pada indeks tersebut.
Sebutkan dan jelaskan struktur data apa saja yang ada pada bahasa pemrograman python?Sekarang kita akan mempelajari struktur data List, Tuple, Set, dan Dictionary.. 1. List. List adalah salah satu struktur data dalam bahasa pemrograman python yang mampu menyimpan kumpulan data (objek/nilai), yang disebut elemen list. Elemen pada list tersimpan menurut urutan (sequence) tertentu. ... . 2. Tuple. ... . 3. Set.. Apa itu Pop pada python?.pop() untuk menghapus item pada index tertentu.
|