Python3入门机器学习 经典算法与应用 轻松入行人工智能
作者:互联网
download:Python3入门机器学习 经典算法与应用 轻松入行人工智能
bobo老师特为机器学习初学者量身打造,使用新版python3语言和流行的scikit-learn框架,算法与编程两翼齐飞,由浅入深,一步步的进入机器学习的世界。学到的不只是一门课程,更是不断思考的能力。
适合人群及技术储备要求
如果你对机器学习感兴趣,想从业于机器学习,或是准备参加机器学习相关比赛,本课程非常适合你
学前必备技术
Python3基础语法
具备高等数学,线性代数,概率论基本知识
课程对机器学习基础知识要求是0基础
package com.chengxinet.bobo.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**
- Created by Administrator on 2016/1/7.
*/
public class NetworkUtils {
public static boolean isNetworkAvailable(Context c) {
Context context = c.getApplicationContext();
// 获取手机一切衔接管理对象(包括对wi-fi,net等衔接的管理)
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager == null) {
return false;
} else {
// 获取NetworkInfo对象
NetworkInfo[] networkInfo = connectivityManager.getAllNetworkInfo();
if (networkInfo != null && networkInfo.length > 0) {
for (NetworkInfo aNetworkInfo : networkInfo) {
// System.out.println(i + "===状态===" + networkInfo[i].getState());
// System.out.println(i + "===类型===" + networkInfo[i].getTypeName());
// 判别当前网络状态能否为衔接状态
if (aNetworkInfo.getState() == NetworkInfo.State.CONNECTED) {
return true;
}
}
}
}
return false;
}
/**- 判别WIFI能否翻开
- @param context
- @return
*/
public static boolean isWifiEnabled(Context context) {
ConnectivityManager mgrConn = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
TelephonyManager mgrTel = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
return ((mgrConn.getActiveNetworkInfo() != null && mgrConn
.getActiveNetworkInfo().getState() == NetworkInfo.State.CONNECTED) || mgrTel
.getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS);
}
/** - 判别能否是3G网络
- @param context
- @return
*/
public static boolean is3rd(Context context) {
ConnectivityManager cm = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkINfo = cm.getActiveNetworkInfo();
if (networkINfo != null
&& networkINfo.getType() == ConnectivityManager.TYPE_MOBILE) {
return true;
}
return false;
}
/** - 判别是wifi还是3g网络
- @param context
- @return
*/
public static boolean isWifi(Context context) {
ConnectivityManager cm = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkINfo = cm.getActiveNetworkInfo();
if (networkINfo != null
&& networkINfo.getType() == ConnectivityManager.TYPE_WIFI) {
return true;
}
return false;
}
}
标签:networkInfo,return,入门,人工智能,ConnectivityManager,context,NetworkInfo,Context,Pytho 来源: https://blog.51cto.com/u_15161311/2695749