雲端計算.

Slides:



Advertisements
Similar presentations
Example 2 The following table gives the mileage y, in miles per gallon, of a certain car at various speeds x (in miles per hour). a) Use a graphing utility.
Advertisements

Math – Getting Information from the Graph of a Function 1.
Introduction to Biostatistics and Bioinformatics Exploring Data and Descriptive Statistics.
Regression Analysis Week 8 DIAGNOSTIC AND REMEDIAL MEASURES Residuals The main purpose examining residuals Diagnostic for Residuals Test involving residuals.
Scientific Python Numpy Linear Algebra Matrices Scipy Signal Processing Optimization IPython Interactive Console Matplotlib Plotting Sympy Symbolic Math.
Data analysis tools Subrata Mitra and Jason Rahman.
Matplotlib SANTHOSH Boggarapu.
Practical Kinetics Exercise 3: Initial Rates vs. Reaction Progress Analysis Objectives: 1.Initial Rates 2.Whole Reaction Kinetic Analysis 3.Extracting.
Practical Kinetics Exercise 2: Integral Rate Laws Objectives: 1.Import Experimental Data (Excel, CSV) 2.Fit to zero-, first-, and second-order rate laws.
Python & NetworkX Youn-Hee Han
Python Lab Matplotlib - I Proteomics Informatics, Spring 2014 Week 9 25 th Mar, 2014
SYSTOLIC BLOOD PRESSURE VS. WEEKLY HOURS WORKED BY NURSES Group members: Miles, Haylee, David, and Nai.
LogisticRegression Regularization AI Lab 방 성 혁. Job Flow [ex2data.txt] Format [118 by 3] mapFeature function [ mapped_x ][ y ] Format [118 by 15] … [118.
CS 5163 Introduction to Data Science
Introduction to python
PH2150 Scientific Computing Skills
Python for Data Analysis
Python for data analysis Prakhar Amlathe Utah State University
Artificial Neural Networks
Lecture 3. Fully Connected NN & Hello World of Deep Learning
Speaker Classification through Deep Learning
IPYTHON AND MATPLOTLIB Python for computational science
Applications of Deep Learning and how to get started with implementation of deep learning Presentation By : Manaswi Advisor : Dr.Chinmay.
Data Mining Tools some examples.
Basic machine learning background with Python scikit-learn
Python for Quant Finance
Prepared by Kimberly Sayre and Jinbo Bi
CSC 1315! Data Science Lecture 18.
Marine and Coastal Biodiversity Management in Pacific Island Countries
MIT 802 Introduction to Data Platforms and Sources Lecture 1
Suppose the maximum number of hours of study among students in your sample is 6. If you used the equation to predict the test score of a student who studied.
PH2150 Scientific Computing Skills
Python Visualization Tools: Pandas, Seaborn, ggplot
IST256 : Applications Programming for Information Systems
Balance Scale Data Set This data set was generated to model psychological experimental results. Each example is classified as having the balance scale.
Ying shen Sse, tongji university Sep. 2016
التدريب الرياضى إعداد الدكتور طارق صلاح.
Matplotlib.
Interpolation and curve fitting
CAR EVALUATION SIYANG CHEN ECE 539 | Dec
Python for Data Analysis
Machine Learning Interpretability
雲端計算.
Option One Install Python via installing Anaconda:
Pandas John R. Woodward.
雲端計算.
雲端計算.
Deep Neural Networks: A Hands on Challenge Deep Neural Networks: A Hands on Challenge Deep Neural Networks: A Hands on Challenge Deep Neural Networks:
Determine the type of correlation between the variables.
7. Power in Packages JHU Physics & Astronomy Python Workshop 2018
Discrete-Event Simulation and Performance Evaluation
Perceptron by Python Wen-Yen Hsu, Hsiao-Lung Chan
雲端計算.
Presented By :- Ankur Mali IST 597
Dr. Sampath Jayarathna Cal Poly Pomona
National Central University, Taiwan
Dr. Sampath Jayarathna Cal Poly Pomona
Card 1 – Choose the correct graph and explain
Dr. Sampath Jayarathna Old Dominion University
Chapter 13 Multiple Regression
Training Up: Intro to Python
Python for Data Analysis
Matplotlib and Pandas
The Student’s Guide to Apache Spark
PYTHON PANDAS FUNCTION APPLICATIONS
Analysis on Accelerated Learning Cohorts
Using Clustering to Make Prediction Intervals For Neural Networks
Beating the market -- forecasting the S&P 500 Index
Machine Learning for Cyber
Machine Learning for Cyber
Presentation transcript:

雲端計算

Tensorflow python

Tensorflow

Load the necessary libraries and import data import math from IPython import display from matplotlib import cm from matplotlib import gridspec import matplotlib.pyplot as plt import numpy as np import pandas as pd import sklearn.metrics as metrics import tensorflow as tf from tensorflow.python.data import Dataset tf.logging.set_verbosity(tf.logging.ERROR) pd.options.display.max_rows = 10 pd.options.display.float_format = '{:.1f}'.format california_housing_dataframe = pd.read_csv("https://download.mlcc.google.com/mledu-datasets/california_housing_train.csv", sep=",") california_housing_dataframe = california_housing_dataframe.reindex( np.random.permutation(california_housing_dataframe.index)) california_housing_dataframe["median_house_value"] /= 1000.0 print(california_housing_dataframe)

Set up the input function def my_input_fn(features, targets, batch_size=1, shuffle=True, num_epochs=None): # Convert pandas data into a dict of np arrays. features = {key:np.array(value) for key,value in dict(features).items()} # Construct a dataset, and configure batching/repeating. ds = Dataset.from_tensor_slices((features,targets)) # warning: 2GB limit ds = ds.batch(batch_size).repeat(num_epochs) # Shuffle the data, if specified. if shuffle: ds = ds.shuffle(buffer_size=10000) # Return the next batch of data. features, labels = ds.make_one_shot_iterator().get_next() return features, labels """Trains a linear regression model of one feature. 參數 Args: features: pandas DataFrame of features targets: pandas DataFrame of targets batch_size: Size of batches to be passed to the model shuffle: True or False. Whether to shuffle the data. num_epochs: Number of epochs for which data should be repeated. None = repeat indefinitely Returns: Tuple of (features, labels) for next data batch """ buffer_size :size of the dataset from which shuffle will randomly sample

Train the model

Synthetic feature: 由多個feature組成 california_housing_dataframe["rooms_per_person"] = ( california_housing_dataframe["total_rooms"] / california_housing_dataframe["population"]) calibration_data = train_model( learning_rate=0.05, steps=500, batch_size=5, input_feature="rooms_per_person") 用rooms_per_person當作feature

Use rooms_per_person as the input_feature to train_model()

Identify outliers Scatter plot of predictions vs. targets plt.figure(figsize=(15, 6)) plt.subplot(1, 2, 1) plt.scatter(calibration_data["predictions"], calibration_data["targets"]) subplot(m, n, k): 把圖形視窗切成 m x n 格,畫在第k格。 順序由左而右,由上而下。

Identify outliers Plot a histogram of rooms_per_person plt.subplot(1, 2, 2) _ = california_housing_dataframe["rooms_per_person"].hist()

Identify outliers

Clip outliers Setting the outlier values of feature to some reasonable minimum or maximum.

驗收: Clip outliers & histogram Setting the outlier values of rooms_per_person to some reasonable minimum or maximum. Plot a histogram of rooms_per_person Hint: use min()

Python3.5 modules

modules

Packages

Packages

驗收 建一個ramdom_List.py從0~100產生10個隨機的數字 可使用: random.sample(range(),) 建一個compare.py使用ramdom_List.py產生的數字找出最大最小值並做 排序 可使用: max()、min()、sorted()、sorted(,reverse=True)