Use an Intent

Add onclick method on main java file and xml file.

res > layout > activity_main.xml

<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:tools="http://chemas.android.com/tools"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:background="@color/tan_background"
	android:orientation="vertical"
	tools:context="com.example.android.miwok.MainActivity">

	<TextView
		android:id="@+id/numbers"
		style="@style/CategoryStyle"
		android:background="@color/category_numbers"
		android:text="Numbers"
		android:onClick="openNumberList" />

	<TextView
		android:id="@+id/family"
		style="@style/CategoryStyle"
		android:background="@color/category_family"
		android:text="Family Members" />

	<TextView
		android:id="@+id/colors"
		style="@style/CategoryStyle"
		android:background="@color/category_colors"
		android:text="Calors" />

	<TextView
		android:id="@+id/phrases"
		style="@style/CategoryStyle"
		android:background="@color/category_phrases"
		android:text="Phrases" />

</LinearLayout>

MainActivity.java

package com.example.android.miwok;

import android.conent.Intent;
import android.support.v7.app.AppCompactActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompactActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	public void openNumbersList(View view){
		//TODO: Write your code here!
		Intent i = new Intent(this, NumbersActivity.class);
		startActivity(i);
	}
}

android intent tutorial site
http://www.vogella.com/tutorials/AndroidIntent/article.html#usingintents_call

Read MainActivity.java

MainActivity
intent -> NumbersActivity, FamilyActivity, ColorsActivity, PhraseActivity

package com.example.android.miwok;

import android.support.v7.app.AppCompactActivity;
import android.os.Bundle;

public class MainActivity extends AppCompactActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}
}
<application
	android:allowBackup="true"
	android:icon="@mipmap/ic_launcher"
	android:label="Miwok"
	android:supportsRtl="true"
	android:theme="@style/AppTheme" >
	<activity android:name=".MainActivity" >
		<intent-filter>
			<action android:name="android.intent.action.MAIN" />

			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>
	</activity>
	<activity android:name=".NumbersActivity" >
	</activity>
	<activity android:name=".FamilyActivity" >
	</activity>
	<activity android:name=".ColorsActivity" >
	</activity>
	<activity android:name=".PhrasesActivity" >
	</activity>
</application>

Navigate to other activities: intent

Miwok language

Miwok app to start off
app / src / main / res / layout / activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
          http://www.apache.org/licenses/LICENSE-2.0
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/tan_background"
    android:orientation="vertical"
    tools:context="com.example.android.miwok.MainActivity">

    <TextView
        android:id="@+id/numbers"
        style="@style/CategoryStyle"
        android:background="@color/category_numbers"
        android:text="@string/category_numbers" />

    <TextView
        android:id="@+id/family"
        style="@style/CategoryStyle"
        android:background="@color/category_family"
        android:text="@string/category_family" />

    <TextView
        android:id="@+id/colors"
        style="@style/CategoryStyle"
        android:background="@color/category_colors"
        android:text="@string/category_colors" />

    <TextView
        android:id="@+id/phrases"
        style="@style/CategoryStyle"
        android:background="@color/category_phrases"
        android:text="@string/category_phrases" />

</LinearLayout>
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.example.android.miwok;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Set the content of the activity to use the activity_main.xml layout file
        setContentView(R.layout.activity_main);
    }
}

Linear Regression

what decision needs to be made?
what information do we need?

tickets per customer per week
past average predict future average
determine the right analytical approach

average number, number of employees, value of contract, industry

linear regression model
-number of employees and number of ticket
– y = mx + b (slope and y-intercept)

calculate a linear equation
y = 0.1833x – 11.055

Business Methodology

Numeric:number (regression model)
Classification:category(non numeric)

ex.
Tricycle Manufacturer

Numeric Model: what type of numeric?
-continuous, time based, count
continuous models, time series analysis

non-numeric -> binary, non-binary

Selecting an Analytical Methodology

methodology map

business problem
-predict outcome, data analysis

Non-predictive Analysis
-Geospatial, Segmentation, Aggregation, Descriptive

geospatial analysis:types off non-predictive data analysis
-location base data, geographic data
Segmentation Analysis
-grouping together
Aggregation Analysis
-calculating a value across a group or dimention
Descriptive Analysis
-descriptive statistics provides simple summaries of a data sample
-mean, median, mode, standard deviation, interquartile range

Predictive Business Problems
– do you have data on what you are trying to predict?

Data Rich vs. Data Poor
-do not have useful data to solve problems
-experiment is business context, a/b test, estimate sales of new product

The Analytical Problem Solving Framework

-Strategy for solving problems
-Non-predictive data Analysis
-Predictive Analysis
-Linear Regressions

Framwork(cross industry standard process for data mining)
business issue understanding, data understanding, data preparation, analysis modeling, validation, personalization

business issue understanding:what decision needs to be made?
what information is needed to inform that decision?
what type of analysis will provide the information to inform that decision?

how can we predict hourly temperatures?
what data is needed?
what data is available?
what are the important of the data?

data preparation
-gather, cleanse, format, blend & combine, sample

analysis modeling
-predict temperature, predict electricity usage
build predictive model, validate model, repeat process, perform analysis

validation
presentation and visualization

slope

steepness, comparing staircases
5feet, 10feet
slope = 5/5 = 1, 10 /5 = 2, 50/15 = 10/3

slope is vertical change/horizontal change = rize / run
positive slope is uphill, negative slope is downhill

y = mx + b
m is always the slope
b is the y-value of the y-intercept

y = 3x – 7
slope:3
y-intercept:(0, -7)