Demo entry 6741747

in[1]

   

Submitted by anonymous on May 16, 2018 at 13:16
Language: Python 3. Code size: 1.3 kB.

import numpy as np 
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
from scipy import stats
from scipy.stats import randint

# 准备库
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
from sklearn.datasets import make_classification
from sklearn.preprocessing import binarize, LabelEncoder, MinMaxScaler
plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签

# 模型库
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier

# 验证库
from sklearn import metrics
from sklearn.metrics import accuracy_score, mean_squared_error, precision_recall_curve
from sklearn.model_selection import cross_val_score

from sklearn.grid_search import RandomizedSearchCV

# Bagging库
from sklearn.ensemble import BaggingClassifier, AdaBoostClassifier
from sklearn.neighbors import KNeighborsClassifier


# 输入数据
from subprocess import check_output
print(os.listdir('F:/ugthesis/techsurvey'))
train_df = pd.read_csv('F:/ugthesis/techsurvey/survey.csv')


#列出表格大小
print(train_df.shape)
    
#列出数据分布范围
print(train_df.describe())
    
#列出数据类型
print(train_df.info())

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).