This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import libraries | |
# sklearn reference: https://scikit-learn.org/0.19/about.html#citing-scikit-learn | |
# pandas reference: https://pandas.pydata.org/ | |
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score, StratifiedKFold | |
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer | |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.model_selection import train_test_split | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.pipeline import Pipeline, FeatureUnion | |
import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All the python code below for use: | |
# import library | |
import pandas as pd | |
# read in your dataframe | |
df = pd.read_csv('/Users/data.csv') | |
# print out your first five rows | |
df.head() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All the python code below for use: | |
# import library | |
import pandas as pd | |
# read in your dataframe | |
df = pd.read_csv('/Users/example.csv') | |
# write out new rows | |
rows = [pd.Series([100, 100, 20,'Blue','Label_1'], index=df.columns), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import libraries | |
# sklearn reference: https://scikit-learn.org/ | |
# pandas reference: https://pandas.pydata.org/ | |
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer | |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.model_selection import train_test_split | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.pipeline import Pipeline, FeatureUnion | |
from sklearn import metrics | |
import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import libraries | |
# sklearn reference: https://scikit-learn.org/0.19/about.html#citing-scikit-learn | |
# pandas reference: https://pandas.pydata.org/ | |
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer | |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.model_selection import train_test_split | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.pipeline import Pipeline, FeatureUnion | |
from sklearn import metrics | |
import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[ ]: | |
from example.introduction_class import IntroductionClass | |
import pandas as pd | |
class testClass(IntroductionClass): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[ ]: | |
class IntroductionClass: | |
def __init__(self, data): | |
self.data = data |
NewerOlder