This file contains 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
A warning occurred (42 apples) | |
An error occurred |
This file contains 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
# Importing the tasty stuff | |
from sklearn.model_selection import train_test_split | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.metrics import confusion_matrix | |
from sklearn.externals import joblib | |
X = finalDf['size_in_mb'] | |
y = finalDf['pop_categories'] |
This file contains 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
from sklearn.tree import DecisionTreeClassifier | |
myClassifier2 = DecisionTreeClassifier(max_depth = 5, min_samples_leaf = 2) | |
myClassifier2.fit(X_train, y_train) | |
predictions2 = myClassifier2.predict(X_test) | |
cnf2 = confusion_matrix(y_test, predictions2) | |
score2 = accuracy_score(y_test, predictions2) | |
print ("Confusion Matrix for our Decision Tree classifier is :\n ", cnf2) |
This file contains 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
model = Sequential() | |
# Tier one | |
model.add(Conv2D(32, kernel_size=5, input_shape = (28, 28, 1), activation='relu', padding = 'Same' )) | |
model.add(Conv2D(64, kernel_size=5, activation='relu')) | |
model.add(BatchNormalization()) | |
model.add(MaxPooling2D(pool_size = (2, 2))) | |
model.add(Dropout(0.33)) | |
model.add(Conv2D(128, kernel_size=3, activation='relu')) | |
model.add(Conv2D(256, kernel_size=3, activation = 'relu')) |
This file contains 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
from marshmallow_jsonapi import fields | |
from marshmallow_jsonapi.flask import Relationship | |
from app.api.helpers.utilities import dasherize | |
from app.api.schema.base import SoftDeletionSchema | |
from utils.common import use_defaults | |
@use_defaults() | |
class TaxSchemaPublic(SoftDeletionSchema): |
This file contains 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
from flask import request | |
from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship | |
from flask_rest_jsonapi.exceptions import ObjectNotFound | |
from sqlalchemy.orm.exc import NoResultFound | |
from app.api.bootstrap import api | |
from app.api.helpers.db import get_count, safe_query | |
from app.api.helpers.exceptions import ForbiddenException, ConflictException, MethodNotAllowed | |
from app.api.helpers.permission_manager import has_access | |
from app.api.helpers.utilities import require_relationship |
This file contains 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
from flask import Flask | |
from flask_rest_jsonapi import Api | |
from your_project.permission import permission_manager | |
app = Flask(__name__) | |
api = Api() | |
api.init_app(app) | |
api.permission_manager(permission_manager) |
This file contains 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 { createMuiTheme, ThemeProvider } from "@material-ui/core/styles"; | |
import React, { useState } from "react"; | |
export default function Dashboard() { | |
const [darkState, setDarkState] = useState(false); | |
const palletType = darkState ? "dark" : "light"; | |
const darkTheme = createMuiTheme({ | |
palette: { | |
type: palletType, | |
} |
This file contains 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 { createMuiTheme, ThemeProvider } from "@material-ui/core/styles"; | |
import React, { useState } from "react"; | |
export default function Dashboard() { | |
const [darkState, setDarkState] = useState(false); | |
const palletType = darkState ? "dark" : "light"; | |
const darkTheme = createMuiTheme({ | |
palette: { | |
type: palletType, | |
} |
This file contains 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 { createMuiTheme, ThemeProvider } from "@material-ui/core/styles"; | |
import React, { useState } from "react"; | |
import Switch from "@material-ui/core/Switch"; | |
export default function Dashboard() { | |
const [darkState, setDarkState] = useState(false); | |
const palletType = darkState ? "dark" : "light"; | |
const darkTheme = createMuiTheme({ | |
palette: { | |
type: palletType, |
OlderNewer