Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

sergioprates

🏠
Working from home
View GitHub Profile
View cloudSettings
{"lastUpload":"2020-09-13T21:20:27.543Z","extensionVersion":"v3.4.3"}
View sergiocsgo.cfg
bind c "use weapon_knife;use weapon_flashbang";
bind f "use weapon_knife;use weapon_smokegrenade";
bind "v" "use weapon_knife;use weapon_molotov; use weapon_incgrenade"
bind capslock "use weapon_knife;use weapon_hegrenade";
bind z "+lookatweapon";
@sergioprates
sergioprates / extensions.json
Last active Nov 17, 2019
vscode-extensions
View extensions.json
[
{
"metadata": {
"id": "70378119-1d85-4935-9733-0298c7a369a2",
"publisherId": "steoates.autoimport",
"publisherDisplayName": "steoates"
},
"name": "autoimport",
"publisher": "steoates",
"version": "1.5.3"
View treinamento_imdb_parte_2.py
from sklearn.svm import LinearSVC
clf = LinearSVC(C=10, random_state=0)
clf.fit(X_train, y_train)
View tfidf_vetorizador_imdb_parte_2.py
from sklearn.feature_extraction.text import TfidfVectorizer
vect = TfidfVectorizer(ngram_range=(1,4), use_idf=True, lowercase=True, min_df=2, max_df=0.95)
vect.fit(df.text_pt)
text_vect = vect.transform(df.text_pt)
View predict_logistict_regression_parte1_imdb.py
from sklearn.metrics import f1_score
y_prediction = clf.predict(X_test)
f1 = f1_score(y_prediction, y_test, average='weighted')
print(f1)
View LogisticRegression_imdb_parte1.py
from sklearn.linear_model import LogisticRegression
clf = LogisticRegression(random_state=0, solver='newton-cg')
clf = clf.fit(X_train, y_train)
View treino_teste_countvectorizer_imdb.py
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test = train_test_split(
text_vect,
df.sentiment,
test_size = 0.3,
random_state = 42
)
View countvectorizer_sklearn_imdb.py
from sklearn.feature_extraction.text import CountVectorizer
vect = CountVectorizer(ngram_range=(1, 1))
vect.fit(df.text_pt)
text_vect = vect.transform(df.text_pt)
View conversao_positivo_negativo_imdb.py
df.sentiment = df['sentiment'].map({'pos': 1, 'neg': 0})
df.head()