Skip to content

Instantly share code, notes, and snippets.

View FelixChop's full-sized avatar

Félix Revert FelixChop

View GitHub Profile
data.to_csv('my_new_file.csv', index=None)
data = pd.read_csv('my_file.csv')
data = pd.read_csv('my_file.csv', sep=';', encoding='latin-1', nrows=1000, skiprows=[2,5])
import pandas as pd
data = pd.read_csv('my_file.csv')
model = XGBClassifier(silent=False,
scale_pos_weight=1,
learning_rate=0.01,
colsample_bytree = 0.4,
subsample = 0.8,
objective='binary:logistic',
n_estimators=1000,
reg_alpha = 0.3,
max_depth=4,
gamma=10)
eval_set = [(X_train, y_train), (X_test, y_test)]
eval_metric = ["auc","error"]
%time model.fit(X_train, y_train, eval_metric=eval_metric, eval_set=eval_set, verbose=True)
nx.draw(G)
import networkx as nx
G = nx.from_pandas_edgelist(df=d, source=column_ID, target=column_ID+'_2', edge_attr=column_edge)
G.add_nodes_from(nodes_for_adding=df.ID.tolist())
import networkx as nx
G = nx.from_pandas_edgelist(df=d, source=column_ID, target=column_ID+'_2', edge_attr=column_edge)
G.add_nodes_from(nodes_for_adding=d.ID.tolist())