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
update_lexicon!(crps) |
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
crps = Corpus(df[:, :Message2]) |
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
remove_case!.(df[:, :Message2]) | |
prepare!.(df[:, :Message2], strip_html_tags| strip_punctuation| strip_numbers) | |
stem!.(df[:, :Message2]) |
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
df = @chain df begin | |
DataFrames.transform(:Message => ByRow(x -> StringDocument(x)) => :Message2) | |
end |
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
df = CSV.read("spam_dataset.csv", DataFrames.DataFrame) | |
first(df, 10) |> pretty |
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
using DataFrames | |
using CSV | |
using Gadfly | |
using TextAnalysis | |
using MLJ | |
using Chain | |
using Pipe | |
using StableRNGs |
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
> ] | |
> activate . | |
> add IJulia BenchmarkTools Plots DataFrames CSV MLJ MLJModels TextAnalysis PyCall Chain Pipe Compose Gadfly Query Statistics StatsBase StableRNGs PrettyPrinting |
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 numpy as np | |
from sklearn import preprocessing | |
features = np.array([[-500, 5], | |
[2, 10], | |
[4, 100], | |
[9, 10]]) | |
# Create the Standard Scaler | |
standard_scaler = preprocessing.StandardScaler() | |
# Apply the Standard Rescaling on our feature maps | |
scaled_feature = standard_scaler.fit_transform(features) |
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 numpy as np | |
from sklearn import preprocessing | |
features = np.array([[-500, 5], | |
[2, 10], | |
[4, 100], | |
[9, 10]]) | |
# Create the MinMax Scaler | |
minmax_scaler = preprocessing.MinMaxScaler(feature_range=(0,1)) | |
# Apply the MinMax Rescaling on our feature maps | |
scaled_feature = minmax_scaler.fit_transform(features) |
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
Filter | Use | |
---|---|---|
Mean Filter | Reduce Gaussian Noise smooth the image after upsampling. | |
Median Filter | Reduce salt and pepper noise. | |
Sobel Filter | Detect edges in an image. | |
Gaussian Filter | Reduce noise in an image. | |
Canny Filter | Detect edges in an image. | |
Weiner Filter | Reduce additive noise and blurring. |